[Bese-devel] javascript

Lou Vanek vanek at acd.net
Mon Jun 26 22:24:05 UTC 2006


Hi Attila,

How do you delay-eval the javascript scripts in the ajax branch?
It's not being done in the main trunk so I added function wrappers
around all javascript scripts and call them (via javascript) after
the page has finished loading (and after dojo.js has finished loading).
If I don't do this then I get errors indicating the 'dojo' variable
is undefined, which it is since the dojo file usually hasn't finished
downloading until after the page has fully loaded. (At least upon
first-load, when dojo hasn't made its way into the browser cache yet.)

BTW, here are some of my latest dojo tests:

o  firefox properly caches dojo and does not try to load it again
o  IE6 gets confused and tries to load it once per page
o  Opera 9 is utterly hopeless and asks for dojo twice per page load.
    Opera is also javascript-challenged and so I've pretty much given
    up hope trying to get my scripts to run on it.

This was tested on winxp.

Part of the problem was that dojo.js was being included twice in the response
headers but that's easy to fix, and the above test results still apply.

Another interesting fact: if there's anybody out there using clisp on
windows you should replace the "write-sequence" calls with
ext:write-char-sequence, or
ext:write-byte-sequence.
I'm seeing a 57,000% speed up in downloads after doing this, but
it's probably just my sucky windows platform.

Lou Vanek




More information about the bese-devel mailing list