FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

one popup

 


linexpert
hello!
On my website i want there to be one popup that opens up www.google.com
Basically, when the user comes to my site i want a small window to open up that's www.google.com

how can i do so?
timerecords
There are two steps you need to do.

Step 1. Past the folowing code between your HEAD tag in your HTML file.

Code:
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  leejoo -->
<!-- Web URL:  http://www.leejoo.nl -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.leejoo.nl -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=0,resizable=0,width=200,height=200,left = 476,top = 332');");
}
// End -->
</script>



Step 2. Past this onLoad event handler in your BODY tag.

Code:

<BODY onLoad="javascript:popUp('http://www.google.nl')">

<!You're Welcome, Noureddine Design !>
linexpert
Thanks! Will try it out soon and let you know how it works. Very Happy
timerecords
You're welcome, tell me if something is wrong...I guess I made it too small...200px at 200px
mariohs
hey guys, just a tip... try to use Unobtrusive Javascript
it keeps your code clean, and you separate content (html or xhtml) from behavior (javascript)
if you still use css, then you separate all: content, style and behavior...
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.