Page 1 of 1

help!!!!

Posted: Sat Jun 02, 2012 4:02 am
by Shim
hello guys ,

i just want a javascript or and html code to popup a new window and navigate to a website it should happen when a visitor enters my website

so please can anyone help me ???

Re: help!!!!

Posted: Sat Jun 02, 2012 12:00 pm
by comathi
Use this code in the <body> tag of your html code:
Code: Select all
<body onload="window.open("http://www.yoursite.com")">

Re: help!!!!

Posted: Sat Jun 02, 2012 2:02 pm
by Codex
comathi wrote:
Use this code in the <body> tag of your html code:
Code: Select all
<body onload="window.open("http://www.yoursite.com")">
I think that that would cause a error, not sure though, if it does, try using single quotes:
Code: Select all
<body onload="window.open('http://www.yoursite.com')">

Re: help!!!!

Posted: Sat Jun 02, 2012 2:29 pm
by comathi
Codex wrote:
comathi wrote:
Use this code in the <body> tag of your html code:
Code: Select all
<body onload="window.open("http://www.yoursite.com")">
I think that that would cause a error, not sure though, if it does, try using single quotes:
Code: Select all
<body onload="window.open('http://www.yoursite.com')">
Oh yeah, I forgot about that. You do indeed need to use the simple quotes, as the double quotes are already used for the purpose of adding JavaScript to the <body> element. ;)

Re: help!!!!

Posted: Sun Jun 03, 2012 12:05 am
by Shim
comathi wrote:
Codex wrote:
comathi wrote:
Use this code in the <body> tag of your html code:
Code: Select all
<body onload="window.open("http://www.yoursite.com")">
I think that that would cause a error, not sure though, if it does, try using single quotes:
Code: Select all
<body onload="window.open('http://www.yoursite.com')">
Oh yeah, I forgot about that. You do indeed need to use the simple quotes, as the double quotes are already used for the purpose of adding JavaScript to the <body> element. ;)
thank you comathi + codex