Monday, March 16, 2009

How to create popup windows

The HTML and Javacript below will show you how to create popup windows in a simplest way.

First, copy this script into the section of your page:

<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>

Secondly, insert HTML code:

<a href="popupbasic.html" onClick="return popup(this, 'notes')">my popup</a>

You done!

0 comments:

Post a Comment