Well I\'m simply playing around with a userscript of GreaseMonkey and here\'s just something simple I attempt to do;
function test() {
document.getElementById(\'
If you are using Greasemonkey then you don't really need a using onload event since the Greasemoneky script is called only when DOMContentLoaded
is fired.
The code in a Greasemonkey user script gets invoked when the DOMContentLoaded event fires (during event capture as of GM 0.8.6). It is a DOM event implemented by Mozilla, similar to window.onload. However, since it waits only for the DOM to load, instead of the entire page (including images, style sheets, and etc.) it happens sooner.
http://wiki.greasespot.net/DOMContentLoaded
I think you would just need to call test()
without any event listeners.