[Greasemonkey] Adding a javascript file?

Stefan Zochowski spz at nofate.com
Wed May 24 23:58:30 EDT 2006


Hi,

I'm really new to all of this and can't find any resources online - I'm 
sorry if this has been answered before had my searches not been 
exhaustive enough.

Are we supposed to be able to do something along the lines of:

document.body.innerHTML=document.body.innerHTML+'xx<b>x</b> <SCRIPT 
language="JavaScript"> \nalert("worked!");\n </script>xxxx';

So I mean, with greasemonkey add javascript to the page? 

If I view (generated) source I'll see the 'xx' parts, but I don't see 
the script part, and needless to say it doesn't work.  I know for the 
above example I can simply have the alert within the greasemonkey 
script, but I'm trying to include a set of javascript files (so <script 
src="" ...>) - and I'm not sure if it's supposed to work, or if I'm 
doing something wrong, or if there's a better way of handling this.

Thanks,

Stefan


More information about the Greasemonkey mailing list