当前位置: 动力学知识库 > 问答 > 编程问答 >

cross domain - Can an Ajax script access different website's webpage?

问题描述:

Can an Ajax script access different website's webpage? for example i tried following

xmlhttprequestobj.open("GET","google.com",true);

What is wrong with this code?

网友答案:

No, it cannot, due to the Same Origin Policy: http://en.wikipedia.org/wiki/Same_origin_policy

网友答案:

Your request is valid if the endurl (in your case.. google.com) supports returning data in jsonp format.

网友答案:

No, you cannot access webpages of other domains and hosts, even i tried the same thing you tried, due to security reasons browsers do not allow so.

分享给朋友:
您可能感兴趣的文章:
随机阅读: