Popup Page

Any problem with javascript can be discussed here.
Post Reply
coco
Posts: 50
Joined: Thu Dec 23, 2004 12:01 pm
Contact:

Popup Page

Post by coco »

Once your page loads, after the number of seconds you define, a popup window will open.

<!-- TWO STEPS TO INSTALL POPUP PAGE:

1. Copy the coding into the HEAD of your HTML ****
2. Add the onLoad event handler into the BODY tag -->



<head>

<script type="text/javascript" language="JavaScript">
<!-- Begin
function popupPage() {
var page = "http://www.8sky.info/popup.html";
windowprops = "height=500,width=500,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=yes";

window.open(page, "Popup", windowprops);
}
// End -->
</script>

</head>



<body onload="setTimeout('popupPage()', 5000);">

</body>


kaos_frack
Posts: 504
Joined: Sat May 07, 2005 8:03 am
Contact:

Post by kaos_frack »

if you change 'setTimeout' to 'setInterval' a new pop-up will open every 5 seconds, lol
znad
Posts: 250
Joined: Sat Oct 01, 2005 3:12 pm

Post by znad »

thanks for this code I will use it in my site :?
kaos_frack
Posts: 504
Joined: Sat May 07, 2005 8:03 am
Contact:

Post by kaos_frack »

also you can determine if your popup window has been blocked or not
like this:

var win1 = window.open(sumtin, sumtin1, sumtin2);
if(win1.closed)
{
alert("Ouch, you need to disable your popup blocker!");
}

lol
AndersW
Posts: 20
Joined: Mon Mar 27, 2006 11:15 pm

Post by AndersW »

can't wait to use this!
WOW! Anders!
EnacheVladian
Posts: 87
Joined: Wed Mar 22, 2006 4:54 pm

Post by EnacheVladian »

isnt this annoying for your visitors ?

personally i wont ever come back to a site who does this kind of things
sethamin
Posts: 46
Joined: Thu Apr 06, 2006 5:47 pm
Contact:

Post by sethamin »

EnacheVladian wrote:isnt this annoying for your visitors ?

personally i wont ever come back to a site who does this kind of things
Me either. I despise popups as I thought everyone else did. :evil:
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

kaos_frack wrote:also you can determine if your popup window has been blocked or not like this:

Code: Select all

var win1 = window.open&#40][/quote]
This is sometime usefull to know, is user blocking popups or not, when creating sophisticated web systems were sometimes you need to open popup on <Body onLoad...> method, so you can tell user that he would allow popups for my site. But i dont use popups very often, i only use them for previewing how form's data will look like on page. But i think sometimes it's valuable
Image
Post Reply