Published on: 2005-08-15 - Views: 4521

Digg! del.icio.us Furl reddit spurl bloglines ma.gnolia.com Yahoo MyWeb technorati blogmarks blinklist pixelgroovy Share this tutorial on tutorialicio.us! simpy
This tutorial will teach you how to have a link open in a popup window.
We'll need to declare a function in the <head> section of our page and then we'll call this function from a special javascript link.
First of all you need to prepare the page you want to open in the popup window: it can be a plain html page, or a php page with includes and so on...
Let's write the popup function:
function mypopup()
{
window.open ('pages/pagetoopen.php','null', "height=250,width=450,status=yes,toolbar=no,menubar=no,location=no");
}
This function opens the page located at "pages/pagetoopen.php" in a new window of 250 by 450 px with a status bar but without toolbar, menubar and url bar.
Now let's have a look at the code to make it open; it's used as any link in your web page but the syntax is the following:
<a href="javascript: mypopup()">Open it Now!</a>