Hi, JMan...

Did you get any answers to your questions?

I've been working a lot with jQuery/ajax/ColdFusion
lately.  It's all new to me and I've been learning a lot.
Perhaps some of what I've learned may be of use to you.

I haven't been injecting HTML into the DOM of the ajax
calling page, but creating HTML to display ajax results.

And I've also learned some about being able to transfer
variables between functions.

Does any of this sound like what you're looking for?

Let me know.  I'll be glad to share some code samples
with you.

What's you backend language?

Rick

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of JMan
Sent: Wednesday, April 01, 2009 1:40 PM
To: jQuery (English)
Subject: [jQuery] Managing scripts in AJAX applications


One thing I have been struggling with is AJAX applications is managing
the js code that powers them.

For example if you have a page that loads content from an AJAX call to
the server and that content also has js code associated with it in
order to function how do I manage that code? If I have 20 pages that
get loaded from the server via AJAX at one point or another I do not
want to have one huge js file with a bunch of code for each page in
it.

I was wondering if it's better to embed the js for each page loaded
via AJAX or call it separately? Normally when I need chunks of HTML &
js, like a data grid for example; that get loaded in via AJAX call I
do not have this called code in the traditional HTML doc, in other
words the HTML being loaded has no HTML head, body etc.. it's just
HTML generated by the server and injected into a section of the
calling page. So in this situation should I load the script that is
required by the HTML via the success callback?

Another delima is communicating events and such between chunks of
loaded HTML/js, like if I have a Tabs widget and an accordion on the
same page and each have content loaded via AJAX and the content in tab
1 needs to bind and interact with events in a section of the accordion
content loaded via AJAX.

Reply via email to