[Greasemonkey] Using functions in JavaScript Includes

Jeremy Dunck jdunck at gmail.com
Thu Aug 18 12:14:46 EDT 2005


On 8/18/05, Richard Wallis <Richard.Wallis at talis.com> wrote:
> OK, I thought it would be something like that just to clarify it (in my
> old brain) the "Library code" would be in the xx.user.js file?
> 
> Is it a variation on the same problem that causes the not defined error
> when I try to call fun1() from my xx.user.js script?

Sorry, I meant this:

In yourserver.com/utils.js:

function DoStuffWithGM(param1, gmapifunc) {
 gmapifunc('foo!');
}

======
In foo.user.js:
//inject <script src="yourserver.com/utils.js"> here..
//...later...
DoStuffWithGM('waka', GM_log);


More information about the Greasemonkey mailing list