[Seaside] Non-blocking jQuery load

jtuchel jtuchel at objektfabrik.de
Thu Nov 19 08:59:44 UTC 2015


in our application, the user sees a dashboard right after logging in.
Depending on the configuration of this dashboard, load and render times can
get quite long.

So we tried to wrap slow components into a Decoration that uses load() to
postponbe the loading of their content. The render code in our decoration
looks like this: 

		ifTrue: [div with: [self renderNextOn: html]]
		ifFalse: [
			html document addLoadScript: (
				(html jQuery: self idSelector) load html: [:r |
					replaced := true.
					self renderNextOn: html]).
			div with: [
				html image src: someSpinnerImage
				html space; text: self message]]

Thus, we hoped, the page would display very quickly, and be responsive
before all the widgets are loaded.

So far, we've reached one of the two goals: the page now loads quickly and
the widgets use ajax to load their contents later. Another nice side effect
is that if you go back to the start page, all widgets are loaded already.

The other goal, however, is not met: If you log in and immediately click on
one of the menu items, the browser won't react to your click before all
widgets have finished loading. So it seems like jQuery's load is blocking.

We've tried in Chrome and Firefox, and both expose this behavior. 
Does anybody know how to not only cheat on the load times of our dashboard
but also enable the browser to react on clicks before all widgets have
loaded their contents?

Any hint is appreciated,


View this message in context: http://forum.world.st/Non-blocking-jQuery-load-tp4861881.html
Sent from the Seaside General mailing list archive at Nabble.com.

More information about the seaside mailing list