Re: Non-blocking jQuery load

Johan Brichau <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <[email protected]>
> On 20 Nov 2015, at 09:57, Johan Brichau <[email protected]> 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
[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.