[Seaside] hand-written javascript in Ajax

Lukas Renggli renggli at gmail.com
Thu Jun 5 06:24:36 UTC 2008

> When the user
> clicks on the link it makes an Ajax call and adds to a collection on the
> server.

Ok, if you don't want to update then simply use the AJAX requestor:

     (html request callback: [ coll add: 123 ])

This expression gives you a string that when evaluated by the
Javascript engine triggers the execution of the Smalltalk block on the

If you need to pass some data from the JavaScript world to the server
you can use something like that:

      (html request
           callback: [ :v | coll add: v ]
           value: (SUStream on: 'navigator.appName'))

In this case the property navigator.appName is passed to the server.
As far as I understand you want to pass some Google Maps data there.

> I tried to use the code you provided in one method and I get:
> MessageNotUnderstood: SUScript>>render:

I write most of the examples for the mailing-list directly in the
mail-application, therefore there is usually some significant amount
of fixing needed before usage. I only try to clear what the general
approach is.

For the example in the previous mail: Remove #asJavascript, the thing
is already a string. SUScript in my Seaside 2.8 images understands

> tried using #render:on: and didn't get much better results.  Am I using an
> out of date Scriptaculous package?

I don't know what platform and version you are on.


Lukas Renggli

More information about the seaside mailing list