getJSON using an IP is not working getJSON using an IP is not working ajax ajax

getJSON using an IP is not working


You are violating the same origin policy. If you control the destination site, you should either consider using a JSONP style of call or enable the cross domain option (crossDomain) on your site and in your AJAX call.

Your browser won't make the call, by default, if you're violating same origin. You'll know that by watching your HTTP traffic using Fiddler, FireBug or Chrome Tools. You won't see your request even executed. If that's the case, then take one of the approaches above.

I hope this helps. Good luck!


The reason is simply cross-domain protection : ajax querying of json from another domain (apparently) can only be done if specific headers are given by the server.

I suggest you read this complete reference as this is now an essential thing to know in order to code ajax based applications.

Use the same name for both.