0

I currently have it setup as a body onLoad, but I would prefer a 15 second delay using any other function that would get the job done.

<body onLoad="popIt=window.open('http://www.example.com/insight',

'popIt', 'toolbar=0, location=0, directories=0, menuBar=0, scrollbars=1, 

 resizable=1, width=900, height=900, left=500, top=500');">

What would be the best way to go about enacting a popup upon a 15 second delay? Thank You

sectus
  • 15,605
  • 5
  • 55
  • 97
posh2.0
  • 13
  • 1

3 Answers3

1

Try using setTimeout(). It can take a function and a time as arguments:

setTimeout(function(){alert("Hello")}, 3000);
1

Something like this?

<body onLoad="window.setTimeout(function() {popIt=window.open('url');}, 15000);">

J148
  • 576
  • 1
  • 4
  • 17
0

Use setTimeout:

<body onLoad="setTimeout(function(){window.open('http://www.example.com/insight');}, 15000);">

Note that the second argument to setTimeout is the time delay in milliseconds.

celeritas
  • 2,191
  • 1
  • 17
  • 28