Forum Moderators: open

Message Too Old, No Replies

Javascript help

There is something wrong with the code i do not know what it is

         

augutus sneakheart

4:50 pm on Oct 4, 2005 (gmt 0)

10+ Year Member



Can someone please tell me what is wrong with this javascript code - it is linked to a textbox and button so that when someone types in the text box itis automatcially transferred to the advert.

<!-- Begin
function popUp(URL) {
var epi = "&epi=" + document.1&1 internet1.htm.epi.value;
//alert(epi);
//alert(URL + epi);
day = new Date();
id = day.getTime();

var w=500;
var h=150;
var scrW=((screen.width - w) / 2);
var scrH=((screen.height - h) / 2);

adWin=window.open(
URL + epi,
'page' + id,
'menubar=no,toolbar=no,location=no,status=no,scrollbars=no,width=' + w + ',height=' + h + ',left=' + scrW + ',top=' + scrH + ''
)

if(parseInt(navigator.appVersion) >= 4){
setTimeout('adWin.focus();',150);
}
}
// End -->

Your help is very appreciated

garann

5:38 pm on Oct 4, 2005 (gmt 0)

10+ Year Member



Just going with my gut reaction, I'd think your problem is here:

var epi = "&epi=" + document.[b]1&1 internet1[/b].htm.epi.value; 

Does it work if you change the name of the element I've bolded to something without spaces or ampersands?

augutus sneakheart

7:48 pm on Oct 4, 2005 (gmt 0)

10+ Year Member



i tried that but it still does not work

thanks for the suggestion though

garann

8:02 pm on Oct 4, 2005 (gmt 0)

10+ Year Member



Hmmm.. In that case, could you post a bit of your HTML? Also, how is it not working? Do you get an error,l or does nothing happen?

Bernard Marx

10:02 pm on Oct 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks for the suggestion though

I think garann would agree that it's more an absolute necessity!

Eltiti

10:14 pm on Oct 4, 2005 (gmt 0)

10+ Year Member



absolute necessity

Yep --as is, it's definitely not valid JS!