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/