Re: Execute jQuery script upon #onAjaxComplete?

"Esteban A. Maringolo" <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAJMgPCLWmeeY6mJRsuHF=jGcCMYW3R0giOkF5VhBgw2YWVmyoA@mail.gmail.com>
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 <[email protected]>:

> 2016-09-23 18:18 GMT-03:00 Esteban A. Maringolo <[email protected]>:
>
> > 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
>
>

_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.