I am trying to build some code in jquery that won’t work without specifying an event or function like $(document).ready function.
But while using the script in Greasemonkey I am unable to run the code the moment I enclose it in $(document).ready function. Is there a way out?
$('div').live('blur',function(){
//the code goes here
});
Well the above code worked pretty fine but I don’t want an even, just as soon as the page loads the code should run.
$ is unknown in GM, you’ll need to access it using unsafeWindow:
(Note that usually blur will not fire on div-elements)
GM-scripts will be executed on DOMContentLoaded(What is the same like the ready-event of a document in jQuery )
http://wiki.greasespot.net/DOMContentLoaded