问题描述:

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.

相关阅读:
Top