[Javascript] window.open() not working in onLoad() of Mozilla 1.5

David Lovering dlovering at gazos.com
Sat May 1 08:17:15 CDT 2004


Well, one can always fudge a click handler onto something invisible (or
off-screen at any rate), and then trigger it to force the code to go active.
Ugly, and round-about, but sometimes necessary.

document.myForm.button1.click()

where button 1  has the onClick declaration you cited earlier.

I didn't realize that the popup blockers had become quite so pervasive -- my
fully patched IE6.02+ still handles window.open calls in the appropriate
code.  However, I don't have access to all the other platforms, and may not
have considered all the flavors of Mozilla in my earlier pronouncement.

-- Dave Lovering

----- Original Message ----- 
From: "Cutter (JavaScript List)" <java.script at seacrets.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Saturday, May 01, 2004 6:53 AM
Subject: Re: [Javascript] window.open() not working in onLoad() of Mozilla
1.5


> That is because window.open(), when not used in conjunction with a
> clickable area/link, is considered "popup" code. Mozilla's built in
> popup blocker would supress the event. This is standard in every browser
> available now with the exception of IE, but that is being corrected when
> XP Service Pack 2 is released later this month.
>
> Cutter
>
> Antony Paul wrote:
>
> >Hi all,
> >  I have problem in opening a new window from the onLoad() event of the
body
> >in Mozilla 1.5. It is calling another function which opens a new window.
If
> >I call the function in a button click it works.
> >This is syntax I used
> >var x = window.open("newwindow.jsp","name","toolbar=no,location=no");
> >
> >It is invoked in onLoad();
> ><body onLoad="winOpen()">
> >
> >what is wrong with it. It is not giving any error in the JavaScript
console.
> >
> >Antony Paul
> >
> >_______________________________________________
> >Javascript mailing list
> >Javascript at LaTech.edu
> >https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> >
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>





More information about the Javascript mailing list