I am trying to load the JSON and alert it but I am not able to do this simple thing. I am confused have done this before but now it doesn't work. A simple fiddle would be helpful, this is how I tried it:
$.getJSON("https://www.mariyano.com/app-server/test/?action=get_list", function(json) {
alert("JSON Data: " + json.data.id);
});
I am getting the error...
XMLHttpRequest cannot load https://www.mariyano.com/app-server/test/?action=get_list. Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin.
for this I tried using a callback:
$.getJSON("https://www.mariyano.com/app-server/test/?action=get_list&callback=?",function(json) {
alert("JSON Data: " + json.data.id);
});
and it threw up two errors:
Resource interpreted as Script but transferred with MIME type text/html: "https://www.mariyano.com/app-server/test/?action=get_list&callback=jQuery18205437749766279012_1353579335783&_=1353579335798". jquery-1.8.2.js:8304
Uncaught SyntaxError: Unexpected token :