Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-20-2003, 05:08 AM   PM User | #1
tbirnie
New to the CF scene

 
Join Date: Jul 2003
Location: Orlando, FL
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
tbirnie is an unknown quantity at this point
javascript help

I hope someone out there can help me...
I am building a website (not published yet) and have one particular page that has got several graphics in a table (I use FP2002) and I am trying to code the javascript to open each one when they are clicked on individually - with the following script:

<script>

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="o-d-penny-copper.htm"
winpops=window.open(popurl,"","width=340,height=200,resizable,")
}

</script>

The first pop-up works fine, but is the same graphic on all five, no matter which one is clicked on. When I add a semicolon and another url or anything to the "var popurl line" then nothing works. I get "The page cannot be displayed".

What am I doing wrong? Please help.
tbirnie is offline   Reply With Quote
Old 07-20-2003, 05:28 AM   PM User | #2
scriptkeeper
Regular Coder

 
Join Date: Apr 2003
Location: Northern California
Posts: 169
Thanks: 0
Thanked 0 Times in 0 Posts
scriptkeeper is an unknown quantity at this point
Well Im kinda not following you completly but you should use an array try this
Code:
<script language="javascript" type="text/javascript">

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts
var popUrls=["http://ww.whatever1.com",""http://ww.whatever2.com","http://ww.whatever3.com","http://ww.whatever4.com"]

function openpopup(index){
winpops=window.open(popUrls[index],"","width=340,height=200,resizable,")
}

</script>

<img src="img1.jpg" onclick="openpopup(0)"/>
<img src="img2.jpg" onclick="openpopup(1)"/>
<img src="img3.jpg" onclick="openpopup(2)"/>
<img src="img4.jpg" onclick="openpopup(3)"/>
scriptkeeper is offline   Reply With Quote
Old 07-20-2003, 11:30 PM   PM User | #3
tbirnie
New to the CF scene

 
Join Date: Jul 2003
Location: Orlando, FL
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
tbirnie is an unknown quantity at this point
Thanks Scriptkeeper, I'll thy that and see if it works. If so, great; if not, I will post to this thread again w/ the new script used. Thanks again...
tbirnie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:50 PM.


Advertisement
Log in to turn off these ads.