The following line of script code works correctly:
When onclick is executed, the variable "myPhoto" is correctly loaded as the source for "myImg" which is then displayed.
I need to accomplish several tasks when "onclick" is executed and I am trying to setup a subroutine "mySub" to perform the various tasks. I created a subroutine as follows, located in the <body> of the html routine.
I replaced the above line of code with :
to pass the parameter "myPhoto" to the subroutine, but I keep getting the error message "Object Expected".
Can anyone tell me what I am doing wrong?
Thanks - Patrick Russell
Code:
w('<input type=radio name=rad onclick="myImg.src=\'../Audio Streaming/'+myPhoto+'\';">');
I need to accomplish several tasks when "onclick" is executed and I am trying to setup a subroutine "mySub" to perform the various tasks. I created a subroutine as follows, located in the <body> of the html routine.
Code:
<sub mySub(x) { myImg.src=\'../Audio Streaming/'+x); }
Code:
w('<input type=radio name=rad onclick="mySub(myPhoto)">');
Can anyone tell me what I am doing wrong?
Thanks - Patrick Russell
Comment