如何使用jQuery读取外部HTML页面?
我正在使用.ajax函数从外部页面读取数据. 我无法阅读该页面,但由于访问控制允许来源而出现异常. 我想在我的页面中显示另一页面的数据,甚至设置crossdomain:true,但有帮助
I am using .ajax function to read data from an external page . I am not able to read the page and I get the exception as Access Control Allow origin. i want to show the data of another page in my page I even set crossdomain:true but it dint help
$.ajax({
type: "GET", url: myurl,
dataType: "html",
crossDomain:true,
success:parsehtml});
如何使用jquery读取外部html页面?
How to read an external html page using jquery ?
大多数现代浏览器中的基础Javascript引擎不允许跨域事务.您将必须使用服务器端语言(例如PHP)来执行此操作. Mozilla对这个问题有相当不错的描述.
The underlying Javascript engines in most modern browsers don't permit Cross-Domain transactions. You will have to use a server-side language such as PHP to do this. Mozilla has a fairly decent description of this issue.