Include javascript files in ajax loaded content

B

battle.chris

Hello.

I'm using Prototype's Updater class to refresh sections of a page. Is
there a way to include an external javascript files in the updated
content; i.e., have a javascript tag with src attribute? Can't seem to
get this to work.

Also, if there is a way, will the browser cache any dynamically loaded
scripts?

Thanks.
 
E

eggie5

Hello.

I'm using Prototype's Updater class to refresh sections of a page. Is
there a way to include an external javascript files in the updated
content; i.e., have a javascript tag with src attribute? Can't seem to
get this to work.

Also, if there is a way, will the browser cache any dynamically loaded
scripts?

Thanks.

So for example you have your first page with the ajax code on it that
calls a second page and posts it's contents onto main page. You want
any script tags in second page to be loaded when you ajax call it from
first page?
 
B

battle.chris

(e-mail address removed) said the following on 3/9/2007 10:07 PM:



My apologies to you for that.


Yes, it is simple. This thread:

<URL:http://groups.google.com.au/group/comp.lang.javascript/browse_frm/thr...>

And it's associated links will probably teach you more about what you
are wanting to do than you ever wanted to know. It also covers some of
the pitfalls (especially with IE7 if the first element is a script element).


That depends on server headers and browser settings.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

Thanks Randy!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top