How to open a new console
 
Network Websites
Corporate website
Beautiful Clip Art
Fast Cars
Video Tiger
Fantasy Art
Beauty & Health
Tips & Tricks

Fast Loading Pages
Glowing Links II
Hide E-mail Address
Javascript Links
Link Colors
Marquees
Navigation
New Window
No Underline Links
Out of a Frame
Page Flash Effects
Preload Graphics Protect Graphics
Redirect Scrolling Javascript
Text Roll-Overs
Tooltip Links
[more tips...]

Tutorials
CSS
Colors
Forms
FTP
Image Maps
Meta Tags
Resources

Web Hosting
Counters & Trackers
Domain Names
Graphics
Web Page Design
Java Script
DHTML

 

How to open a new console when someone enters or leaves your site

You've probably seen this on some web sites. When you enter the site, but more frequently when you leave the site, a console pops up with some additional info or ads, or a poll etc. This can be done using Java script.

To Open A Console When Someone Enters Your Site:

<script language="JavaScript">
<!--
window.open('http://www.freewebmastertips.com','HB','toolbar=1, location=1,status=1,menubar=1, scrollbars=1,resizable=1, width=500,height=300');
// -->
</script>

Just place the above code within the BODY tags.

To Open A Console When Someone Leaves Your Site:

Place the following attribute in the <body> tag: onunload="leave()"

For example:

<body bgcolor="#000000" onunload="leave()">

Place the following code between the "</head>" and <body> tag.

<script language="JavaScript">
<!--
var exit=true;
function leave()
{
if (exit)
open("http://www.freewebmastertips.com",'HBexit','toolbar=1,location=1, status=1,menubar=1,scrollbars=1,resizable=1, width=500,height=300');
}
// -->
</script>

Now you will have a console popping up everytime you leave the site. So make sure you use the below attribute in the <a href> tag on links to avoid the exit console from popping up on sponsors and other links where this is not desired.

onclick="exit=false"

For example:

<A HREF="http://www.anydomain.com" onclick="exit=false">

NOTE: Make sure you keep the long string of codes intact; if you break them, they won't work (and that's why this page is different also). To customize the codes, replace the URL in red with the one of your choice. Oh, don't overdo this because your visitors will get annoyed.

Tips and Tricks

Sponsor

Hot Wedding Ideas

Advertise
Really affordable rates.
Feedback
Comments, suggestions?

 

 

home | tips & tricks | tutorials | tools | resources | contact | advertise
© 2000 - 2001 GT Media Inc. All rights reserved.