[Javascript] Problem w/Javascript, interpolation, functions, onclick

Matt Warden mwarden at gmail.com
Tue Oct 24 22:52:36 CDT 2006


On 10/24/06, Nathan V. Patwardhan <nvp at noopy.org> wrote:
>   var actions = new Array (
>       ['Cancel', 'edit_release(this, "cancel")'],
>       ['Submit', 'submit_release(this)']
>   );

I could get your eval to work for you, but then I'd have to take 30
showers. And I still wouldn't feel clean.

Try your array like this instead:

var actions = new Array (
   ['Cancel', function() {edit_release(this, "cancel")}],
   ['Submit', function() {submit_release(this)}]
);

Now, lord knows what you're trying to do with passing 'this'. If you
tell us what you want 'this' to refer to, we can probably help you out
there. Whatever you're wanting it to point to, it ain't.

-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the Javascript mailing list