That's what I tried initially - though for some reason didn't seem to work!
Out of interest - what technique are folks using to create the dom
elements?
raw HTML?
domBuilder?
Dave
Klaus Hartl wrote:
dmoshal schrieb:
Karl, using object literals seems to work:
var a =
{
foo
Hi,
Firstly - wow, what an amazing piece of work - Kudos!
I've been more productive with jQuery in a day than I've been with YUI, and
GWT in weeks.
Question:
how does one pass a function into jQuery, ie
given: function foo(){}
I want to assign it to the element's onclick handler:
) === false ) {
jquery-latest.js (line 999)
-
Dave
AHeimlich wrote:
On 12/11/06, dmoshal [EMAIL PROTECTED] wrote:
given: function foo(){}
I want to assign it to the element's onclick handler:
$(elem).click (foo)
which doesn't seem to work?
Well, that *should* work
Karl, using object literals seems to work:
var a =
{
foo: function()
{
}
}
function bar (a)
{
$(elem).click (a.foo)
}
bar (a)
Dave
Karl Rudd wrote:
That should work. You'll need to show us code that is a little more
specific.
Karl Rudd
On 12/12/06, dmoshal
Excellent, didn't think of that one
thx
Dave
bmsterling wrote:
I had to do something similar today, and I did something like
function myfunction(f){
$(element).click(function(){eval(f+(););});
}
that was off the cuff, but that should work.
--
View this message in context: