You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
Using LABjs to load Prototype and Scriptaculous from a CDN results sometimes in a blank page when using Chrome. The page is seen to load properly but after a fraction of a second the screen turns blank. The page is 'still there', that is inspecting the source reveals all the proper HTML. This behaviour is not consistent, sometimes it does work.
I tried setting AlwaysPreserveOrder to true, to no effect.
I tried moving off the CDN but that resulted in the dynamic libs (such as effects/builder/etc) not to be load at all. It would work when explicitly calling/loading these libs. The blanking would disappear. This makes me believe loading via XHR (UseLocalXHR) has some effect, which I do not know.
It's the use of document.write() in that file. document.write() is NOT compatible with dynamic loaders. There's a race condition inherent that if document.write() is executed before onload, then things are probably ok, but if it goes after that (which can happen intermittently) a document.write() will screw up the page. It can crash IE, and the behavior of seeing the page go blank is quite expected when document.write() runs after a page is loaded.
The solution is to load scriptaculous manually, then load any other files that don't have document.write() in them with LABjs.
I really wish the frameworks would get their act together (like jQuery did) and get rid of this junk that makes dynamic loading impossible.
Thanks for the explaination. I got around the problem by hacking Scriptaculous and removing the dynamic loading of the modules. I then loaded them myself by pointing LABjs to the correct files.
Using LABjs to load Prototype and Scriptaculous from a CDN results sometimes in a blank page when using Chrome. The page is seen to load properly but after a fraction of a second the screen turns blank. The page is 'still there', that is inspecting the source reveals all the proper HTML. This behaviour is not consistent, sometimes it does work.
I tried setting AlwaysPreserveOrder to true, to no effect.
I tried moving off the CDN but that resulted in the dynamic libs (such as effects/builder/etc) not to be load at all. It would work when explicitly calling/loading these libs. The blanking would disappear. This makes me believe loading via XHR (UseLocalXHR) has some effect, which I do not know.
This behaviour can (sometimes as it's not consistent) be seen on our staging server at http://staging.delaagsterekening.nl.
The offending file is http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js
Probably the solution is staring me in the face.
The text was updated successfully, but these errors were encountered: