On 5 Jan., 15:00, Anthony Lieuallen <[email protected]> wrote:
> On 01/05/11 01:19, arif wrote:
>
> > function tester(){
> >    window.location.href="http://www.google.com";;
> >    unsafeWindow.addEventListener ("load", function () { tester2() }, 
> > false);    
> > }
>
> First: Don't use unsafeWindow here.  "window.addEventListener" is
> equivalent, and it is not unsafe.
>
> > The function tester2 never gets called
>
> Of course not.  The immediately previous line changes the location to a
> new document.  So this page stops loading, and scripts in it stop running.

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 
"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