I try to run the following jquery code in local Network.
$.ajax({
type: \"GET\",
url: \"http://SomeSite/MyUrl/\",
cache: false,
data: {
Do you have server access to 'SomeSite', or is it 3rd party?
If you have access you can enable CORS
wp, home on it. In its simplest form (data is not session sensitive), just add the header: Access-Control-Allow-Origin: *
If you don't have access do you know whether it supports JSONP
wp, so? This typically involves passing at least a callback
parameter in the URL. (Of course if you have access you can add JSONP
support too.)
If you don't have access to make changes to 'SomeSite' and it supports neither CORS
nor JSONP
, you might be able to use YQL
wp, home as a proxy. It does support both CORS
and JSONP
and can even translate data formats, select some part of the data, etc.
(Note that YQL respects robots.txt
so if it's a 3rd party site that restricts automated access you might still be out of luck.)
You can try jsonp request http://api.jquery.com/jQuery.ajax/ see crossdomain