Hoque Hoque - 3 months ago 27
Javascript Question

Ways to add javascript files dynamically in a page

I have seen Scriptaculous.js file to include its required javascript files dynamically. Is there any better approach to include javascript dynamically.

For example, I would like to include my js files like,

<script src="single.js?files=first.js,second.js,third.js..."></script>

How can I do that in an efficient manner?


Check this net.tutsplus.com article, which covers many already made solutions.