[Seaside] Calling a DOM method from jQuery
Lukas Renggli
renggli at gmail.com
Fri Apr 24 18:27:04 UTC 2009
> To set the focus to the first field in a jQuery Dialog, I call onOpen:
> ((html jQuery id: #username) call: 'focus()'); Its works fine, but FF
> complains that focus() is not a function. Am I doing something wrong
> here?
The argument to #call: is a method name, not a method call itself. If
you have a look at the generated code with FireBug you can see that
this produces $('#username').focus()(). The methods #call:,
#call:with:, #call:with:with:, etc. are the Javascript counterpart to
#perform:, #perform:with:, #perform:with:with: in Smalltalk.
Another issue -- but that is from my side -- is that #focus is
missing. I will shortly commit a version of JQuery-Core that includes
these event triggers as native methods, so you don't need to use
#call: anymore.
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the seaside
mailing list