Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing name of image into new window in Netscape?

Status
Not open for further replies.

pha2er

Programmer
Dec 4, 2001
16
GB
Hi there,

I'm having some trouble getting the name of an image from my main window, into a new window which opens when the image is clicked (if you know what I mean!).

I'm using the following which works in IE, but not in any netscape version, can anyone shed some light here?

Here's my current code:

<script language=&quot;javascript&quot;>

function getImgName(imgLink) {
var currImg,imgIdx = 0;
while (document.images
) {
currImg = document.images
;
if ((currImg.x == imgLink.x) && (currImg.y == imgLink.y)) {
return currImg.name;
}
}
return false;
}


function PopUpVid(e) {
var video = (document.layers)?getImgName(e.target):e.srcElement.name;
window.open(&quot;../popupvid.asp?br=0&video=&quot;+video,&quot;video&quot;,&quot;width=302,height=365,scrollbars=0&quot;);
}

</script>

And my link and image are as follows:

<a href=&quot;javascript:;&quot; onclick=&quot;PopUpVid(event);return false;&quot;><img border='0' name=mmhaggisend src=' align='Left' alt=' '></a>

Thanks for any help you can give me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top