Solved

popup window

Posted on 1998-06-06
1
194 Views
Last Modified: 2010-04-09
I was visiting a site and it had a small pop-up window that said welcome and then it went away after a few seconds. I tried looking at the page source but could not find out how he did that as I would like to put that on my site to notify everone when I am on vacation. How can this be done?
With example code please, thanks.
0
Comment
Question by:dtucker
1 Comment
 
LVL 4

Accepted Solution

by:
martinag earned 50 total points
ID: 1844118
Put this at your home page:
<SCRIPT LANGUAGE="JavaScript">
<!--
newWindow = window.open('','nW','width=300,height=100,scrollbars=0');
newWindow.location.href = 'welcome.htm';
// -->
</SCRIPT>

Then you'll have to create the pop-up document, welcome.htm:
<HEAD>
<TITLE>Welcome!</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF" ONLOAD="setTimeout('self.close()', 3000);">
<H1 ALIGN="CENTER">Welcome!</H1>
</BODY>
</HTML>

At the BODY-row, we tell the browser to close the window after 3 seconds (= 3000 ms).
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question