Re: Execute jQuery script upon #onAjaxComplete?
"Esteban A. Maringolo" <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.seaside |
|---|---|
| Message-ID | <CAJMgPCJfR4JYJXQtmM_Fw7hS44gYuZTdUw1NexRprVZyZdpDWQ@mail.gmail.com> |
2016-09-23 12:21 GMT-03:00 Mariano Martinez Peck <[email protected]>: > The problem, as usual, is all ajax requests (and my app is now almost everything with ajax). > I need to hook on ajax calls so that I could also re-render the notifications components as > there could have been new notifications since the last rendering. > html > document > addLoadScript: (html jQuery document > onAjaxComplete: ( > (html jQuery id: self systemMessageNotifier mainDivId) replaceWith: [:r | > self systemMessageNotifier renderContentOn: r. > ] > )). > What I don't know how to do is what I want hahhaa. >I would try to avoid WebSockets for the moment. I > thought maybe doing some jQuery polling ? I don't understand what you want to implement. If you want to notify something, then such notification should come as a response of the xhr and implement the ajaxComplete function handler to parse the response searching for the notification you want to display. The alternative is to include a <script> in every ajax response to update the notification on the client side. I also don't see how you using websockets would benefit you unless you hook the socket to an announcer. Regards, -- Esteban