Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Poping up a new window without user action

Status
Not open for further replies.

darkom

Programmer
Apr 14, 2000
28
CA
Hi !

My question is : How do you popup a new browser window without user action. I want to trigger this in an if.

Something like this :
if (soandso)
{
window.open()
}

The only way I know how to open a new window is with :
<INPUT TYPE='button' VALUE='VoirRésultat' OnClick=&quot;window.open('../html/WDJTest.html','Résultat1','width=400,height=200,toolbar=no,location=no,directories=no,status=no,menubar=yes,copyhistory=no,resizable=no')&quot;>

 
put the code in the head and a window will popup, or put the code in a function and activate it with the onLoad event handler.
<head>
<script>
if (soandso){
window.open()}
</script>
</head>

or

<head>
<script>
function open();{
if (soandso){
window.open()}}
</script>
</head>

<body onLoad=&quot;open()&quot;>

good luck

MiQ
mcvdmvs@mcvdmvs.net
Yeah, well, erhm, ok... I'm busy trying to teach myself JavaScript, C++, Java and other webrelated stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top