On Wednesday, Jan 8, 2003, at 12:55 US/Pacific, Ugo Cei wrote:

Ovidiu Predescu wrote:
The 'cocoon' object has a load() function, which takes as parameter the name of the script you want to load. Please let me know if this works for you.
If I put a list of cocoon.load instructions at the beginning of a script, will they be executed when the file is first loaded?
Yes, it is executed as any top-level JavaScript code when the script is first executed in a scope. But:

As I'm looking at the code, I believe there might actually be a problem with the script include functionality. This used to work fine, but I had to change the behavior some time ago to allow scripts to be shared. It may be the case that cocoon.load() is broken in its current state. I'll check this behavior and let you know if it is still correct; if it's not, I'll remove it from JSCocoon.java.

The safest thing to do right now though is to split your code among multiple JS files and include them all in the sitemap:

<map:flow language="JavaScript">
<map:script src="script1.js"/>
<map:script src="script2.js"/>
<map:script src="script3.js"/>
<map:script src="script4.js"/>
</map:flow>

This should work just fine.

Regards,
--
Ovidiu Predescu <[EMAIL PROTECTED]>
http://webweavertech.com/ovidiu/weblog/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



Reply via email to