Endbringer
Technical User
I'm trying to use Javascript to open a window showing a picture along with a close link.I have many pictures and want to know if one javascript function can open them up.I've tried the following, but i can't get it to work.Any help would be appreciated.
<script LANGUAGE="JavaScript">
var pic0 = "carroll1.gif"
var pic1 = "carroll2.gif"
function picWin(pic){
myWin = window.open("","myWin"
imgName.src = pic
myWin.document.write("<html><body>
<img src='imgName'></body></html>"
}
</script>
Here are two of the links that i'm trying to get to work.
<a CLASS="pic" href="javascripticWin(pic0)" target="Main">[Pic #1] </a>
<a CLASS="pic" href="javascripticWin(pic1)" target="Main">[Pic #2] </a>
<script LANGUAGE="JavaScript">
var pic0 = "carroll1.gif"
var pic1 = "carroll2.gif"
function picWin(pic){
myWin = window.open("","myWin"
imgName.src = pic
myWin.document.write("<html><body>
<img src='imgName'></body></html>"
}
</script>
Here are two of the links that i'm trying to get to work.
<a CLASS="pic" href="javascripticWin(pic0)" target="Main">[Pic #1] </a>
<a CLASS="pic" href="javascripticWin(pic1)" target="Main">[Pic #2] </a>