ajax - Jquery getJSON Not Working Cross Site -


I have a piece of javascript that captures JSON data when executed locally though everything seems to work well When I try to use it from a different site, it does not work.

Here's the script.

  $ (function () {var aT = new AjaxTest (); aT.getJson ();}); Var AjaxTest = function () {this.ajaxUrl = "http://mydeveloperpage.com/sandbox/ajax_json_test/client_reciever.php"; This.getJson = function () {$ .getJSON (this.ajaxUrl, function (data) {$ .each (data, function (i, piece) {warning (piece);});}); 

You

Any help would be greatly appreciated.

Thank you!

to:

  • Security restrictions, most "Ajax" requests are subject to the same basic policy; The request can not successfully obtain data from a different domain, subdomain or protocol.

  • The script and the JSONP request are not subject to the same basic policy restrictions.

You will need to use the same basic policy to avoid it. JQuery can make it seamless (see the rest of the documentary documents page).


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -