[Seaside] Non-blocking jQuery load

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Sat Nov 21 06:32:36 UTC 2015


Hi Johan,

Adding a loadScript during an ajax callback is a really cool trick. I've 
got this working - in principle ;-)

There is, however, a problem: jQuery's load doesn't support timeouts 
(nor any other paramters) . So I need to rewrite load as an ajax call 
which supports the timout parameter. Currently struggling a bit, but 
it's a good learning experience ;-)

Again, thanks a lot, you've added a few important building blocks to the 
solution!

Joachim


Am 20.11.15 um 10:06 schrieb Johan Brichau:
>
>> On 20 Nov 2015, at 09:57, Johan Brichau <johan at inceptive.be 
>> <mailto:johan at inceptive.be>> wrote:
>>
>> This perfectly fits your decoration implementation. Something along 
>> these lines (disclaimer: untested code written in email client :) :
>
> The code I sent before will poll a bit too quickly :) I forgot to add 
> a wait on the client:
>
>
> replaced
> ifTrue: [div with: [self renderNextOn: html]]
> ifFalse: [
> html document addLoadScript: (self loadScriptOn: html).
> div with: [
> html image src: someSpinnerImage
> html space; text: self message]]
>
> loadScriptOn: html
>
> (html jQuery: self idSelector) load html: [:r |
> self isDataReady
> ifTrue:[ replaced := true.
>   self renderNextOn: html]
> ifFalse: [ r addLoadScript: ((self loadScriptOn: r) timeout: 1000) ]).
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20151121/049343e2/attachment.htm


More information about the seaside mailing list