
09-12-2007
|
| Senior Member
Join Date: Jun 2007
Posts: 1,399
BRL$: 4,187.66 Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 172 | | calling javascript function using array values What i'm trying to do is use an array or variable to call a particular function. I know that I could use a switch statement to do this, however I would like to find out if it is also possible this way. PHP: --------- function test1() { alert('test1'); } function test2() { alert('test2'); } myArray = new Array(); myArray[0] = "test1"; myArray[1] = "test2"; // I really thought this would work, but it didn't myArray[0](); --------- To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. | |
__________________ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
To receive latest updates about BRL Forums, Subscribe to Latest Updates Thread.
| | | |