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="javascript">
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("../popupvid.asp?br=0&video="+video,"video","width=302,height=365,scrollbars=0"
}
</script>
And my link and image are as follows:
<a href="javascript:;" onclick="PopUpVid(event);return false;"><img border='0' name=mmhaggisend src=' align='Left' alt=' '></a>
Thanks for any help you can give me.
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="javascript">
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("../popupvid.asp?br=0&video="+video,"video","width=302,height=365,scrollbars=0"
}
</script>
And my link and image are as follows:
<a href="javascript:;" onclick="PopUpVid(event);return false;"><img border='0' name=mmhaggisend src=' align='Left' alt=' '></a>
Thanks for any help you can give me.