Javascript questions Re: [Seaside] Textarea and setSelectionRange()

Lukas Renggli renggli at
Tue Mar 17 19:59:00 UTC 2009

> Okay.  Thanks, but isn't it fair to ask what should be Seaside idioms or
> best practices for using Javascript?

Sure, but as I said it mostly depends on the Javascript libraries you are using.

With Scriptaculous ( and
JQuery ( you have totally different
idioms on how to register for events. In these two cases Seaside does
not try to run its own thing, but instead it just provides a nice
Smalltalk API to the Javascript interface.

In any case you can register for Javascript events directly while
rendering the HTML source using the event selectors defined in
WATagBrush, but that doesn't give much flexibility and certainly no
control over order (see

One thing Seaside provides out of the box is the addition of onLoad
scripts. This can be done by evaluating "html document addLoadScript:"
in Seaside 2.9 and "self session addLoadScript:" in earlier versions.
The code added through these calls is evaluated in order when the page
has completely loaded, but there is no control over other Javascript
code that might be present on your site and that might define other
load handlers.


Lukas Renggli

More information about the seaside mailing list