You should read what Anthony wrote and actually think about what is
happening when your code runs. If you load a different page to the one you
are currently on, then the script will stop running and everything starts
over from a blank page.

What you are trying to do is slightly absurd and goes something like this:

Load new page
script starts running
Script adds event listener
Event listener gets called
Firefox executes the line that changes page
Rest of the script is ignored as a new page loads
Repeat above sequence of events

In other words, the "do something at page xxx/yyy" never gets to execute
because you change the page (wipe the event listener) before firefox even
gets to it.

On 7 Jan 2011 16:25, "steveb" <[email protected]> wrote:


On 5 Jan., 15:00, Anthony Lieuallen <[email protected]> wrote:
> On 01/05/11 01:19, arif wrote:
>
...
I have the same problem with my script.
My script looks like the following snippet:

window.addEventListener("load", funX(){

 window.location.href = "http://www.xxx.x";;

 // do something on www.xxx.x

},false);

// do something

window.addEventListener("load", funY(){

 window.location.href = "http://www.yyy.y";;

 // do something on www.yyy.y
}, false);

what can i do to fix my code?












-- 
You received this message because you are subscribed to the Google Groups
"greasemonk...

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to