[jQuery] JSONP - not using PHP - having problems
Hello,
I have read over almost every post in this group and still cannot
figure this out. I am sure it has to do with the way I am creating my
JSON object.
Here is the file I am broadcasting the file from.
http://www.simplifieddesign.biz/jsonTest.html
The source does not include any <html><head> or <body>
just the json
I did have var jsonObject = {"object1" : "test", "object2" : "test2"}
and
var jsonObject = ({"object1" : "test", "object2" : "test2"})
On
http://example.com/develop/wduff/cols/default.html
I have this script in the header
$.ajax({url: "http://www.simplifieddesign.biz/jsonTest.html",
dataType: "jsonp",
success: function(data, textStatus) {
alert(data.object1);
},
error: function(xhr, ts, err){
alert('error' + err);
}
});
/*$.getJSON("http://www.simplifieddesign.biz/jsonTest.html?
callback=?",function(json){
alert("JSON DATA");
});
*/
As you can see I am trying both ways. Really I guess they are the
same.
I tried to put the same alert on both tries and it didnt work then I
tried just calling an alert and the basic string alert does not even
pull up.
Any help would be appreciated. Thanks