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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup message on index page open

Status
Not open for further replies.

sharonc

Programmer
Jan 16, 2001
189
0
0
US
I have a message that I want to popup anytime someone opens my home page. Can someone tell me how to do this.
 
The body tag is part of the template used for all pages, so if I put the onload on the body tag, it will open on every page. Any suggestions?
 
I'm not so sure (yet) of the programming part there, but I would personally think that a best practice would be to not have a pop-up message at all if it can be helped for any web page. The fact is (or so it seems) that the most people, at least, prefer to not have any extra windows pop-up, especially if it is when you first visit a website. For instance, you go to a web site, and you get a message "click here to scan your computer" or "you may have just one $10,000!" I am no expert on the whole web page programming front (though hope to at least move in that direction over the next couple years), but stylistically speaking, any popups messages/windows would probably eventually annoy any regular viewers/users of your website.

Just a thought - of course, in some situations, it may be necessary - I just meant this as a general idea.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Pop ups can be very annoying and blocked. You could create a layer with your message onand have a close message button that could also write a cookie that would stop the layer being displayed in future. However if your user has cookies disabled then the layer will always display.

Cheech

[Peace][Pipe]
 
Windows XP SP2 will block any script initiated pop-up. Use initiated pop-ups (click a button or link) are not routinely blocked.

That said the method for opening a window on page load is:

Code:
<body onload="javascript:window.open('url','name','params');">

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top