JavaScript 可以从 Yahoo 加载 RSS XML 提要吗? ?

是否允许客户端JS访问第三方域名?

请您参考如下方法:

您可以使用我的博文 Unwritten guide to Yahoo Query Langauge 中概述的技术

您可以使用如下 yql 语句查询 XML 数据表:

select * from xml 
  where url="http://path/to/xml
然后,您将使用 src http://query.yahooapis.com/v1/public/yql?q={your yql here} 在 html 中添加脚本标签(可以使用 document.createElement('script') 完成) &format=json&callback={your function here} 其中 {your yql here} 替换为你的 yql statment 的 URI 编码版本。


评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!