<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi Esteban,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">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.</div> <div id="bloop_sign_1522816546980535040" class="bloop_sign"><br></div><div id="bloop_sign_1522816546980535040" class="bloop_sign">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.</div><div id="bloop_sign_1522816546980535040" class="bloop_sign"><br></div><div id="bloop_sign_1522816546980535040" class="bloop_sign">Cheers,</div><div id="bloop_sign_1522816546980535040" class="bloop_sign">Max</div> <br><p class="airmail_on">On 3 April 2018 at 20:08:33, Esteban A. Maringolo (<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Hello all,<br><br>I find myself rendering a lot on JSScript instances via AJAX, and in<br>some cases the elements I render have to create separate <script> tags<br>to initialize or execute something on the client side.<br><br>When doing a full page request we have the addLoadScript: and we can<br>pass that script around our object to append whatever we want on top of<br>it. But on AJAX we don't have such feature.<br><br>Did anybody played with having a `renderContentOn: html script: script`<br>kind of method?<br><br>I haven't fully thought about this, but I guess the script would be<br>initialized very early in the rendering process and would be finally<br>returned as a single <script> tag containing all what was added by the<br>rendered components.<br><br>Best regards,<br><br>--<br>Esteban A. Maringolo<br><br>_______________________________________________<br>seaside-dev mailing list<br><a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br></div></div></span></blockquote></body></html>