Hi!

I've updated your fiddle to work. A couple of minor problems were breaking it:

1. You need to grab "bla". Although elements with an ID get added to the window object automatically, don't rely on or use this behaviour. It's evil. :) 2. Your onClick function has been passed "bla" -- not an event. I've updated your fiddle so that it appends this argument to the document. -- http://jsfiddle.net/nU5Ex/2/

Now, if you want to still have access to the event, *and* pass an argument, you're going to want to use a closure to provide currying-like behaviour. Take a look at http://jsfiddle.net/nU5Ex/4/ to see what I mean. Hopefully that's clear -- ask if you have questions!

- Barry

On 31/08/11 12:24, netSQL wrote:
Thanks for any help.

I put it in jsfiddle: http://jsfiddle.net/puppetmaster3/nU5Ex/

Includes a working example(w/o Mootools) and a non working example(w/
Mootools)

If I can call a named function and pass an arg, that would be great.

Vic


On Aug 30, 4:54 pm, Aaron Newton<[email protected]>  wrote:
First, working on jsfiddle is way better than putting code here (even short
examples) because it's interactive and we can help you fix your code.



--
Barry van Oudtshoorn
www.barryvan.com.au

Not sent from my Apple πPhone.

Reply via email to