Hi Aaron.

a) If you need to load .js in advance because some component might become visible, don’t use a WOConditional. Always deliver the component and use visibility="false" or something equal to get it hidden from the user.

b) As you are doing Ajax which intends to change parts of a page you should implement Mike’s deferred header-modification under 3) below.

c) If you think 3) is to much coding, just include all needed .js in your head (which you have in a central Layout.wo anyway, right?). The Browser will cache them so there won’t be to much overhead.

Hope this helps out.

        atze



Am 07.01.2008 um 19:52 schrieb [EMAIL PROTECTED]:

3) Dynamically load javascript or modify the DOM:
This probably can work. Mike Schrag has also alluded to this in the past as a possible solution. Ideally you could modify the contents between the "head" tags in the DOM and hopefully most browsers would understand that you inserted a JS or CSS reference and load them on the fly, possibly even utilizing the local browser cache. But this would have to be tested and might not work on a "Opera" for example. Another angle would be to always check for the existence of a function or javascript object before blindly using it. If it is not defined, then you could make an Ajax call and download the needed file on the fly, possibly using "evaluate" to load the needed functionality. This would not make use of the cache but would only happen at most once per page. While this is all perhaps possible, it would take a bit of experimentation and may not be totally cross browser compatible.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to