PDA

View Full Version : Popup Script Not Working



proctk
02-01-2006, 01:22 PM
any ideas why this is not working

it breaks at line 153 & 158

I have no clue, I used wise PopUp to create the script

<head>
<script language="JavaScript">
function PopupMe(){
myleft=(screen.width)?(screen.width-300)/2:100;mytop=(screen.height)?(screen.height-400)/2:100;
settings='top=' + mytop + ',left=' + myleft + ',width=300,height=400,location=no,directories=no, menubar=no,toolbar=no,status=no,scrollbars=no,resi zable=no,fullscreen=no'
PopupWin=window.open('http://www.tomorrownextweek.com/promo.html','PopupWin', settings);

function get_cookie(Name){
var search = Name + '=';
var returnvalue = '';
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(';', offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end)) } }
return returnvalue;}
function PopupOnce() {
if (get_cookie('popped')==''){
PopupMe()
document.cookie='popped=yes'}}
</script>
</head>

<body>

<body onload="javascript:PopupOnce()">

</body>

MandyJay
02-01-2006, 01:44 PM
Well for a start you have 2 body tags

<body>

<body onload="javascript:PopupOnce()">

take out the first.

And if that is the code for the whole page you are missing the opening and closing <html> </html> tags ..... it would help if we could see the page live?

MJ

MandyJay
02-01-2006, 01:46 PM
Also, where did you get the script from? if from a third party can we have the url of that too pse.
MJ

proctk
02-01-2006, 02:19 PM
Thank you for the help. The ULR for the site is www.tomorrownextweek.com/promo.html.

also, I'm using a third party program to make my webpage (there is no coding of the main page design just for extras you want to add in

http://www.webpage-maker.com/

were the software come from to write the script
http://www.antssoft.com/


thank you once again

MandyJay
02-01-2006, 02:38 PM
I got a pop up from your home page, although I dont know what was in it as I have pop-ups blocked - but there was one there - but the link you gave (doesnt work but I found the promo page) there is no coding in the page to see the pop up so I dont know about that page ....

MJ

proctk
02-01-2006, 02:39 PM
Sorry about that, I just uploaded the page info. again. Its giving the script error

MandyJay
02-01-2006, 02:41 PM
Also I am not sure why I got a pop up on the home page as this code
<body onload="javascript:PopupOnce()"></div>


</body>
</html>


you have at the very end of the page, and the body tag always goes immediately after the closing </head> tag ... so I would imagine any errors you get could very well be due to the fact that the layout of your page is not as it should be. It should be like this

<html>
<head> all head code goes in hear </head>
<body> the main content of your page goes here </body>
</html>

which is not how you have the page laid out .....

May I suggest you do a totally blank page - put the pop up code onto that page and check to see if it works .... once you get it working on a blank page, then you can transfer the code to the page you want .....
Make sure you only have ONE body tag .... you cant have two ...

MJ

MandyJay
02-01-2006, 02:44 PM
Oh yes I forgot, you have in the code this link
http://tomorrownextweek.com/promo.html

you have the link wrong .... your page is actually this

http://tomorrownextweek.com/Promo.html - with upper case for the Promo

MJ

proctk
02-02-2006, 12:24 PM
thank you for your help. all is working

MandyJay
02-02-2006, 12:28 PM
Great! glad you got it working :clap: :woohoo: :dance:

MJ