Include JavaScript File in a Bookmarklet -


i want use jquery in bookmarklet. included source bookmarklet.js bookmarklet, there no more place jquery file.

i've tried include jquery inside included bookmarklet.js

var s=document.createelement('script'); s.setattribute('src','http://jquery.com/src/jquery-latest.js'); document.getelementsbytagname('body')[0].appendchild(s); 

but doesn't work. did wrong?

try adding 1 more attribute specify type of source file:

s.setattribute('type', 'text/javascript'); 

Comments