[Seaside] Re: Javascript calls through jQuery

Karsten Kusche karsten at heeg.de
Sun Mar 2 18:55:02 UTC 2014

> I want to move as much as I can from the JS file to Seaside, because
> now I need to add certain parameters to the request, and I thought it
> would be simpler to do it with Seaside.

in recent projects i’ve found it’s much easier to do it exactly the other way around. Keep as much code in a js file and configure it via Seaside. Doing jQuery inline in Seaside just makes things more complicated as you need to write the jQuery code in the Seaside style and not plain normal Javascript. It also has the benefits of being easier to debug as you can just set breakpoints at a line. The Seaside-generated Javascript code is typically pretty tight and not pretty-printed, making it extremely hard to debug.

The only places where i use Seaside-jQuery code is when i need to generate render-callbacks or other kinds of callbacks. But as Javascript objects can be assigned to any kind of DOM Object you can separate the callback-code from the other javascript code quite nicely.

Kind Regards

> What I need is to be able to do is:
> 1. fill a form (a set of filters) which will send an ajax call to the
> seaside component
> 2. The seaside component will process the form and decide what to
> return (the JSON response)
> 3. Once the response arrives back at the client side, the json
> response must be passed to another JS function as an argument
> 4. Must repeat item #3 every n seconds.
> I can do this on the JS side, but I still don't get how the whole
> jQuery machinery works in Seaside.
> Seems to be utter powerful, but not as straightforward as simply
> writing the JS :)
> Regards!
> Esteban A. Maringolo
> 2014-02-18 10:05 GMT-03:00 Esteban A. Maringolo <emaringolo at gmail.com (mailto:emaringolo at gmail.com)>:
> > Is there a way I can perform an AJAX call to get a JSON response and
> > pass it to a JavaScript function?
> >  
> > Now I'm gluing everying externally by means of a JS file, but the AJAX
> > calls are outside of the Seaside session (REST Filter), and I'd like
> > to get everything in the same session.
> >  
> > Thanks in advance,
> >  
> > Esteban A. Maringolo
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org (mailto:seaside at lists.squeakfoundation.org)
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20140302/1b8bfffe/attachment.htm

More information about the seaside mailing list