Using jQuery.getJSON in Chrome Extension
Posted
by Paul Tarjan
on Stack Overflow
See other posts from Stack Overflow
or by Paul Tarjan
Published on 2010-04-12T04:05:50Z
Indexed on
2010/04/12
4:13 UTC
Read the original article
Hit count: 482
I need to do a cross-domain request in a chrome extension. I know I can it via message passing but I'd rather stick to just jQuery idioms (so my javascript can also work as a <script src="">
).
I do the normal:
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", callback(function(data) {
alert(data);
});
but in the error console I see:
Uncaught ReferenceError: jsonp1271044791817 is not defined
Is jQuery not inserting the callback function correctly into the document? What can I do to make this work?
© Stack Overflow or respective owner