Brad,

It sounds like what you're asking for is on-demand loading of JS or 
packaging. Try taking a look at these links for suggestions:

http://www.nabble.com/dynamic-plugin-loading-tf2889880.html#a8077929
http://www.jspax.org/

Rey....


Brad Wood wrote:
> Ok, here's a wide open question:
> 
>  
> 
> We are going back through our application and trying to introduce more
> Ajax where we can to dynamically add content when we can instead of
> reloading the entire page.  Example: we often use a tabbed interface,
> and for performance reasons, we only load the content in the selected
> tab.  When the user switches tabs, why reload the entire page just to
> change one part of it?  We'll just do an Ajax call to get the content
> for that tab, and then innerHTML it in to where it would go.
> 
>  
> 
> Well, this is great, but now one of the problems we are running in to is
> JavaScript libraries that we use all over the site.  For instance, we
> have a nifty little calendar drop down custom tag we use.  The calendar
> tag includes the JavaScript library it needs the first time it is
> called.  Well, what if I am ajaxing in some content that has one of
> those calendar drop downs.  How can I programmatically and consistently
> know whether the JavaScript library has already been loaded for it to
> work?  I used to just set a request variable, but that doesn't really
> apply now since the original request scope doesn't exist anymore when I
> make my Ajax call, and furthermore, content could have been removed on
> the page SINCE it originally loaded.
> 
>  
> 
> My first though was to load ALL JavaScript libraries ALL the time
> whether I needed them or not.  I'm not so sure about that though,
> because it sounds like a waste of bandwidth and client memory usage.  Is
> that a valid worry?
> 
>  
> 
> My second thought was to load NONE of my JavaScript libraries off the
> bat, and then load them dynamically as needed.  If I went this approach,
> I would need to either put an if statement around EVERY JS function call
> to check for it BEFORE I called it OR build a wrapper JS function and
> make EVERY JS call go through the wrapper.  I would tell it what
> function I wanted to call, and my arguments.  It would check for its
> existence and Ajax it in if necessary and THEN call it returning the
> result back to the original code.
> 
>  
> 
> Am I making sense here?
> 
> Has anyone tried this before?
> 
> Are there any frameworks made for this?
> 
> Am I over-thinking this?
> 
>  
> 
> ~Brad
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268381
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to