[Bese-devel] javascript

Attila Lendvai attila.lendvai at gmail.com
Mon Jun 26 23:10:13 UTC 2006


> 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.)

well, i'm not a js guru, but this is how one of my page looks like:

<script type="text/javascript">
// <![CDATA[
djConfig =
{ isDebug : true,
  baseLoaderUri : '/cocoma/dojo/' }
// ]]></script
><script type="text/javascript" src="/cocoma/dojo/dojo.js"></script
><script type="text/javascript" src="/cocoma/ucw/js/per-application.js"></script
><script type="text/javascript" src="/cocoma/dwim-static.js"></script

and i think that script tags should be executed in order. somebody
correct me if i'm wrong (but then i'll give up all hope in all www
standards) please check and/or send what it looks like in your pages.

(dojo needs its debug configuration created before it is loaded)

as with the caching of the parenscript: they are generated at the
first request and cached on the server until the lisp file is touched.
it's sent with some cache headers, take a look at
parenscript-dispatcher and server-sequence. i'd be more than happy if
you could fix any possibble issues with cache headers with ie or
opera.

> 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 is my log with opera 8.5 on linux at first load (and after a very
quick test all ajax stuff works):

00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/dwim.ico"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/treemenu.css"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/dwim.css"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/ucw/ucw.css"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/dojo/dojo.js"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/dojo/src/debug.js"
00:54 UCW.BACKEND/+INFO+: Handling request for
"/cocoma/ucw/js/per-application.js"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/dwim-static.js"
00:54 UCW.BACKEND/+INFO+: Handling request for "/cocoma/cocoma.css"
00:54 UCW.BACKEND/+INFO+: Handling request for
"/cocoma/ucw/images/collapsible-off.png"
00:54 UCW.BACKEND/+INFO+: Handling request for
"/cocoma/ucw/images/collapsible-on.png"

> 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.

is it with the stock ucw examples or with a custom application?  stuff
seems to be working here with 8.51 opera and a recent ff.

- attila

(alias 101 on irc &no 'its not lisp code :)



More information about the bese-devel mailing list