-
February 21st, 2004, 05:33 AM
#1
Help! Javascript question...
This has nothing to do with security, but I know no better place to go for help (thanks AntiOnline), so I'm just posting this in the general section. I could really use some help with a javascript issue. I'm still early on in my learning of the script, so I can use all the help I can get.
Okay, I want to create a form with buttons that link to websites. Simple enough. The thing is I don't want to do it the typical way (having the link address in the "onclick" field). I want to have a javascript that defines an array in which each item of that array is a website address. So for instance, I want to create a button that goes to the first link in that array. In other words, if:
var links = new array(3);
links[0]="http://www.website1.com"
links[2]="http://www.website2.com"
links[3]="http://www.website3.com"
So, I want the button in my HTML form to call a function that goes to one of those links. How do I do that?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|