| 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 of all, click the following link to see an example of
our pop-up window:
Back to the top of the page...
Now, let's take a simple HTML anchor tag like the one below:
<A href="#back_to_the_top">
Back to the top of the page...
</A>
and convert it so that it can display a pop-up window when clicked:
<A href="#back_to_the_top"
OnClick = "hint_wnd = window.open( '',
'hint_wnd', 'width=50, height=60, resizable=no, scrollbars=no' );
hint_wnd.document.write( 'Hello there!');
return true;"
>
Back to the top of the page...
</A>
As you can see, we simply added an "OnClick" event tag, made it open a window
named "hint_wnd," and finally wrote the string "Hello, there!"
to the "hint_wnd" window.
Test it!
Back to the top of the page...
|