jQuery的不工作的外部域 [英] Jquery not working for external domains
本文介绍了jQuery的不工作的外部域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在jQuery的功能,试图将HTML从页面:
I have a function in Jquery, that try get html from an page:
$.ajax({
type:'GET',
url: 'http://www.google.com',
success: function( data ) {
alert( data );
}
});
为什么不工作? 在Firebug我看到了通信头。 谢谢advace
why does not works? in firebug I see the communication headers. Thanks in advace
推荐答案
您违反了 SOP 。为了避免SOP uou可能会需要一个服务器端脚本(主机)来加载外部URL和数据返回到您的客户端脚本,或者使用提供的 JSONP 结果。
you are violating SOP. To avoid SOP uou would likely need a server side script (on your host) to load the external url and return the data to your client side script, or use a service that provides a JSONP results.
这篇关于jQuery的不工作的外部域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文