[Seaside] Execute jQuery script upon #onAjaxComplete?

Esteban A. Maringolo emaringolo at gmail.com
Mon Sep 26 01:56:11 UTC 2016


This works:
html document addLoadScript: (
html jQuery document onAjaxComplete:(
(html jQuery id: self classicMenuComponent systemMessageNotifier mainDivId)
load
global: false; "to avoid inifite recursion"
html: [:r | self classicMenuComponent systemMessageNotifier
renderContentOn: r ]
)
)


Given you modify the supported options to include the "global" option.

JQLoad>>#isSupportedOption: aString
^ #('url' 'data' 'complete' 'global' "(" 'dataType' ")") includes: aString


Given load() is a shorthand function in jQuery, there is no reason to not
include such option in the supported ones.

Regards,


Esteban A. Maringolo

2016-09-23 18:28 GMT-03:00 Esteban A. Maringolo <emaringolo at gmail.com>:

> 2016-09-23 18:18 GMT-03:00 Esteban A. Maringolo <emaringolo at gmail.com>:
>
> > Beware you're doing html jQuery ajax every time you evaluate the
> onAjaxComplete: function, and that is discouraged, because you're not
> working in an instance of jQuery, but instead on the class.
>
> Nevermind this, I got confused, it is the ajaxSetup that is discouraged.
> I've been using `html jQuery ajax` all over the place.
>
> It's the #script:/replaceWith: that confused me, I'm used to do what you
> do inside #script: in an onSuccess:/onError: handler and use html: instead
> of #replaceWith:
>
> Regards!
>
> Esteban A. Maringolo
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20160925/2ddb5f88/attachment.htm


More information about the seaside mailing list