document.write('<script type="text/javascript"
src="'+libraryName+'"></script>');
So document.write clobbers the document that you're in if it evals
outside of onload, but it appears to actually look pretty good if I
instead load the javascript file as an Ajax.Request with an
evalScripts: true. There are some semantics that are different with
this in terms of order of evaluation, but it looks hopeful. It
might be the case that to make it generally work reliably that it
will require a synchronous request so the js loads prior to your
component trying to render anything that might touch the js scope.
Yeah, asynchronous: false seems to give better behavior here ... It
blocks loading the javascript, which is more like what the browser
would do normally, and it also makes caching perform better because
multiple components that include the same javascript file don't enter
a race condition resulting in loading the file multiple times (which
doesn't usually cause a problem, but it's just chattier than normal).
I think a little bit more hackery with associating previously loaded
javascript files with the page component (to pickup files that were
loaded in previous non-ajax requests to prevent generating this code
at all) and it's probably close. I have some Real Work (TM) to do, so
I'll come back to this, but barring something terrible cropping up,
look for this maybe next week.
ms
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]