Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery .getJSON Firefox 3 Syntax Error Undefined

Tags:

I'm getting a syntax error (undefined line 1 test.js) in Firefox 3 when I run this code. The alert works properly (it displays 'work') but I have no idea why I am receiving the syntax error.

jQuery code:

$.getJSON("json/test.js", function(data) {
    alert(data[0].test);
});

test.js:

[{"test": "work"}]

Any ideas? I'm working on this for a larger .js file but I've narrowed it down to this code. What's crazy is if I replace the local file with a remote path there is no syntax error (here's an example):

http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?