[Javascript] Changing the arguments in an onClick event

Peter Brunone peter at brunone.com
Wed Jun 2 11:31:39 CDT 2004


Hi Terry,
 
    I've been here before.  You can't change it in the parameter itself;
you'll need to keep an array somewhere that you can check.  The problem
is, if you try to assign a function to an event handler, you can't use
parens or it will execute it right there and pass the result of the
function to the event handler.
 
    That said, if you find a good way to do it, let me know!
 
Cheers,
 
Peter
 

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Terry Riegel


Hopefully this is an easy one.

I have a link

<a href="#" onclick="supersize('image1-big.jpg')"><img
src="image1-med.jpg" id="mainimage"></a>

I have a script that changes the url, can I also change the onclick url
also? Is there a better way to do this?

document["mainimage"].src=url

Terry Riegel
-----------------
MAILKEY: 2524427349


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040602/acfeec29/attachment.htm>


More information about the Javascript mailing list