[Seaside] Non-blocking jQuery load

Johan Brichau johan at inceptive.be
Fri Nov 20 09:06:53 UTC 2015


> On 20 Nov 2015, at 09:57, Johan Brichau <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) ]).

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


More information about the seaside mailing list