[jQuery] getJSON - how do you make it work?
Hi
I'm trying to get some JSON content using the $.getJSON function, but
it just won't work!!
I started out using ASP.NET to generate a load of JSON, but decided to
create a simple text file with a JSON string in it instead.
Here's my JavaScript:
$.getJSON("/test.txt", function(data) {
alert("I got the stuff");
});
$("#msg").ajaxError(function(event, request, settings, error) {
$(this).append("" + error + "
");
});
And my test.txt file contains:
{ "offer": {
"id": 2,
"title": "animals could talk",
"image": "_blank.gif"
}
}
Is there anything really obvious I'm doing wrong?
Thanks
Jon