jquery - AJAX from within a Safari Extension's injected script -


i'm trying expand shorturl using api in injected script in safari extension:

$.getjson('http://api.longurl.org/v2/expand?format=json&url=' +  encodeuricomponent(href) + '&callback=?', function(data) {      console.log(data); }); 

and i'm getting following error:

referenceerror: can't find variable: jquery15103411371528636664_1298845652395 

i've tried different api , same error, know not that. also, if execute same code console, successful response. must being inside safari extension's injected script.

any ideas?

i believe have add jquery plugin first. here's example of how:

var newelement = document.createelement("script"); newelement.type = "text/javascript"; newelement.src = "//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"; document.body.insertbefore(newelement, document.body.firstchild); 

then can jquery in tab using plugin. ;)


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -