JQuery load content from a remote site

给你一囗甜甜゛ 提交于 2019-12-30 07:13:53

问题


I would like to load content from another site using JQuery, Unfortunately the .load() function is limited to the current domain. Is there any way around ? I would like to insert à navigation bar directly into a tumblr blog.


回答1:


Have a look at Ways to circumvent the same-origin policy If you have control over the other side it is quite easy. Otherwise try Yahoos YQL.




回答2:


You can take a look at cross domain ajax request with YQL and jQuery.

http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-cross-domain-ajax-request-with-yql-and-jquery/



来源:https://stackoverflow.com/questions/8973672/jquery-load-content-from-a-remote-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!