Insert dependencies dynamically in View (Javascript and CSS Files)
Posted
by Ph.E
on Stack Overflow
See other posts from Stack Overflow
or by Ph.E
Published on 2010-04-07T13:30:54Z
Indexed on
2010/04/07
13:33 UTC
Read the original article
Hit count: 254
Friends, I am willing to follow the rules of the W3C where it is recommended that javascript and CSS files should be in individual files and not within the page.
Good, following this rule, and not wanting to overload the master page, I would like to embed the dependencies dynamically. So how could I insert the libraries dynamically? I think the bigger problem is the Ajax requests.
Example:
<script type="text/javascript" src="http://sstatic.net/so/js/master.js?v=6523"></script>
I tried using the JavascriptResult, but he writes the content on the page, and do not run as "Stream."
Any help is welcome. Thanks
© Stack Overflow or respective owner