[Seaside-dev] Rendering on HTML and Script canvas

Max Leske maxleske at gmail.com
Wed Apr 4 04:42:10 UTC 2018


Hi Esteban,

Not sure how it currently is in Seaside 3 but in 2.8 #addLoadScript: also
works for asynchronous calls. The downside is, that this has to be done
through the use of eval as script tags aren't executed automatically by the
browsers (IIRC). That is one reason why I'm moving away from scripts
rendered by Seaside. I prefer to have a separate javascript file that knows
what to do and can communicate with the image, e.g. through a JSON API. The
amount of work is obviously a bit greater but I find that it also helps to
separate concerns and improve the design of the application.

That being said, what you want should still be possible for people that
absolutely want to use it, e.g. because they use it only seldomly and don't
want to put in the extra work.

Cheers,
Max

On 3 April 2018 at 20:08:33, Esteban A. Maringolo (emaringolo at gmail.com)
wrote:

Hello all,

I find myself rendering a lot on JSScript instances via AJAX, and in
some cases the elements I render have to create separate <script> tags
to initialize or execute something on the client side.

When doing a full page request we have the addLoadScript: and we can
pass that script around our object to append whatever we want on top of
it. But on AJAX we don't have such feature.

Did anybody played with having a `renderContentOn: html script: script`
kind of method?

I haven't fully thought about this, but I guess the script would be
initialized very early in the rendering process and would be finally
returned as a single <script> tag containing all what was added by the
rendered components.

Best regards,

--
Esteban A. Maringolo

_______________________________________________
seaside-dev mailing list
seaside-dev at lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside-dev/attachments/20180404/4ad1a63a/attachment.html>


More information about the seaside-dev mailing list