DonAtlanta
07-25-2002, 09:59 PM
I want to have a dozen links on my web page
such that clicking each link will pop up a different jpg file in a small window.
I found the code below to create a popup window.
Clicking link "Kevin" should pop up file kevinw.jpg (actually, that works)
Clicking link "Flower" should pop up file
photo19.jpg (that doesn't)
How do I move the variable "popurl" out of the
function so that I can assign it different
values in different places on the web page?
(Obviously variables in java don't work
like variables in BASIC.)
===========================
function openpopup(){
var popurl="kevinw.jpg"
winpops=window.open(popurl,"","width=400,height=338,")
}
</script>
<a href="javascript:openpopup()">Kevin</a>
var popurl="photo19.jpg"
<a href="javascript:openpopup()">Flower</a>
such that clicking each link will pop up a different jpg file in a small window.
I found the code below to create a popup window.
Clicking link "Kevin" should pop up file kevinw.jpg (actually, that works)
Clicking link "Flower" should pop up file
photo19.jpg (that doesn't)
How do I move the variable "popurl" out of the
function so that I can assign it different
values in different places on the web page?
(Obviously variables in java don't work
like variables in BASIC.)
===========================
function openpopup(){
var popurl="kevinw.jpg"
winpops=window.open(popurl,"","width=400,height=338,")
}
</script>
<a href="javascript:openpopup()">Kevin</a>
var popurl="photo19.jpg"
<a href="javascript:openpopup()">Flower</a>