doutang7414 2010-09-06 08:54 采纳率: 0%
浏览 9

如何运行批处理?

I am working on News means I need to include online yahoo news title and description in my page. For that I have to create 1 batch file , but the problem is that how to create that batch file which will call the yahoo online news inside that file then how can I include that file in my page?

Thanks

  • 写回答

1条回答 默认 最新

  • duanhuo7441 2010-09-06 09:41
    关注

    You can do that using javascript on the browser.

    Look for a JSON feed in the Yahoo API, that delivers JSON with a callback function, ie:
    http://search.yahooapis.com/.../news?results=20&output=json&callback=myCallBackFunction

    Then in your page have a global function:

    function myCallBackFunction(json){
    
      //show here the json feed as HTML
    
    }
    

    This technique is commonly called JSONP

    You save some latency for your users by avoiding your PHP to proxy the requests.
    And you won't pay the bandwidth for these data, as they come directly from Yahoo.

    Unfortunately, all this is valid only if your target audience is javascript enabled.

    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改