Welcome to WebmasterWorld Guest from 54.226.241.8

Forum Moderators: open

Message Too Old, No Replies

javascript

problem of location in a command window.open()

     

masterjr

10:12 pm on Jan 4, 2002 (gmt 0)

10+ Year Member



Hello.
i 've a bug in my code.tHis the all code.Infact i want to open a new window when the user click on the image .I should remplace in the the tag <a onclick="">:"location=liens[pub]" by window.open=(url,_blank',"menubar=yes,...").The problem is the url.Please find the time to look the aall code maybe you'll find how to help me.

<html>

<head>

<script language="JavaScript">
<!-- Begin
pubs=new Array();
liens=new Array();
pubT=0;
pub = -1;
function AfficherPub(pubs,pubDelay1) {
pubDelay = pubDelay1;

pub = pub + 1;
if (pub == pubs.length)
pub = 0;
document.pubImg.src = pubs[pub];
pubT = setTimeout("AfficherPub(pubs,pubDelay)", pubDelay1);
}
// End -->
</script>
<script language="JavaScript">
<!-- Begin
function VersionNavigateur(Netscape, Explorer) {
if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ¦¦
(navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
return true;
else return false;
}
// End -->
</script>

</head>
<body onUnload="clearTimeout(pubT)">


<a href="" onClick="location=liens[pub]; return false">
<img name="pubImg" src="image0" width="20" height="20" border="0"></a>

<script language="JavaScript">
<!-- Begin
if (VersionNavigateur(3.0,4.0))
{
pubs[0] = document.pubImg.src;
liens[0]='url0';
pubs[1]="image1"
liens[1]="url1"

AfficherPub(pubs,10000);
}

// End -->
</script>

</body>
</html>

thank you

jsbwm

10:45 pm on Jan 4, 2002 (gmt 0)



I dunno if i get what you are trying to do but if you are asking about an alternitive to <a href="javascript:"> then i would try <a href="#" onClick="myfunction();">. I don't really understand your questions but i hope this helped a bit.
-jim

masterjr

12:39 am on Jan 5, 2002 (gmt 0)

10+ Year Member



thank you.

tedster

6:52 am on Jan 5, 2002 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Continued on this thread [webmasterworld.com]
 

Featured Threads

Hot Threads This Week

Hot Threads This Month