Possible Duplicate:
load content from external page into another page using ajax/query
May be I just don’t get something.
I want to get html page from other site, let it be http://www.server.com/somepage/param
In my js code:
var url = "http://www.server.com/somepage/param";
$.get(url, callback);
Chrome says “Failed to load resource”.
What is wrong?
You’re running into restrictions imposed by the Same Origin Policy. In short, AJAX calls to a different domain are prohibited and will always fail.
You need to either use JSONP (mostly applicable to data returned by APIs) or proxy the request through your own server/domain.