(page requirements)

Pop-up windows (with a little help from JavaScript)

Wouldn't it be nice to pop-up a little window from your web pages to display messages once in a while (rather than jumping to another page)?

Well, it's very easy to do using JavaScript. First, click on the following button to see an example of our pop-up window:

Now, let's look at the code behind the above button:

<FORM METHOD="post">

<INPUT TYPE="button" VALUE="Click me!"

OnClick = "hint_wnd = window.open(
'', 'hint_wnd', 'width=50, height=60, resizable=no, scrollbars=no' );

hint_wnd.document.write( 'Hello there!' );
return true;">


As you can see, we simply use the "OnClick" event open a window named "hint_wnd," and finally write the string "Hello, there!" to the "hint_wnd" window.

Applicable Keywords : HTML, Internet Explorer, Explorer 3.x, Explorer 4.x, Explorer 5.x, Internet, JavaScript, JavaScript 1.0, JavaScript 1.1, JavaScript 1.2, Netscape Navigator, Navigator 2.x, Navigator 3.x, Communicator 4.x, Netscape 6.x, World Wide Web
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor