Web Hosting Directory | Web Hosting Resources | Webmaster Resources | Domain Tools | Search Engine Marketing | Forums
  Signup
Today: 901   Yesterday: 1,172   Max: 1,872   Total: 384,282   Current Users : 22 (Member 0) 
DOMAIN TOOLS

WEBMASTER TOOLS

RELATED ARTICLES

SUBMIT AN ARTICLE

Write for us and get publicity, link to your website, and best of all get paid. Please visit our writers page for details.


LINK TO US

Link to us and earn points for each visitor you bring to us. Please visit our link partner page for details.

 

Popup Windows: Opening Automatically

In the first two examples (Popup Windows: The Basics and Popup Windows: From an Image Map) the popup is opened when the user clicks on something. In this example the popup opens automatically.

We'll use the same script as in the first example. Copy this script in the <HEAD> 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>

This time, instead of running the script from a link we'll run it from the onLoad attribute of the <BODY ...> tag.

<BODY onLoad="popup('autopopup.php', 'ad')">

The command in onLoad is run when the document is finished loading. Like in our previous example, the command runs popup(), but this time the first argument for popup() is a little different. In the previous example we put this, meaning the link itself, and the script got the URL from the link. In this case there is no link so we pass the actual URL to open. So in our example we put 'autopopup.php'.



Copyright 1997-2002 Idocs, Inc. Written by Miko Sullivan.

 
 
What is your major source of website traffic?
 
 
 
 
 
 

ADVERTISEMENT

 
Cheap Web HostingBudget Web HostingEcommerce Web Hosting
Link to UsLink ExchangeAdvertisePrivacy PolicyTerms Of ServiceAbout UsContact UsSitemap
Copyright © 2006 - 2008 Broadband Media, Inc. All rights reserved.