EchoEcho.Com Homepage
Web Hosting - As Reliable As It Gets!
   Home > Tutorials > Javascript > Advanced


 Tutorials 
 D-Zine Articles 
 Online Tools 
 Free Resources 
 References 
 Quiz 
 Hosting 

















  Popup Windows :
EXAMPLE








This is a ready to use script that will allow you to easily open new windows on your pages.

You can customize the script using the information in the preceeding section.

The script needs to be placed in the <head> section of your HTML document.

<script Language="JavaScript">
<!--
function popup(url, name, width, height)
{
settings=
"toolbar=yes,location=yes,directories=yes,"+
"status=no,menubar=no,scrollbars=yes,"+
"resizable=yes,width="+width+",height="+height;

MyNewWindow=window.open("http://"+url,name,settings);
}
//-->
</script>


Once the script is added to your page, you can open windows using this syntax for the link tags:

<a href="#" onClick="popup('www.yahoo.com', 'Win1', 300, 300); return false">
Click Here To Go to Yahoo</a>


Try the script by pressing the link below:








If you don't want to use the ready to use script in the previous section, click here to go to the Popup Windows Tool.

Note:
In the example, we named the window "MyWindow".If you have more than one popup window on the same page, you need to rename the window names.
Use for example "MyWindow1", "MyWindow2" etc.


 << PREVIOUS
BACK TO MENU >>  
















DEVELOPER TIP!
FACT:
Changing the <FONT> tag does not affect the color of your links.
TIP:
Unless you place the <FONT> tag between the <A href> and the </A> tags of your link.





     "Better Than Books - As Easy As It Gets!"


On EchoEcho: D-Zine Articles | Tutorials | Online Tools | Free Resources | References | Quiz | HostingAbout EchoEcho