views:

100

answers:

2

I recently came across the includeMany jQuery plugin to include external JavaScript and CSS files into a page. Although it was released in early 2009 there are NO references in blogs or elsewhere. I wonder if it's usable? What is the experience using it?

+5  A: 

You can include JavaScript and CSS using the example below. There is no need for any plugins.

To include JavaScript code, do this:

$.getScript("youpathtoscript.js",function() {
            //this script is loaded
});

To include CSS files:

$("<link/>", {
   rel: "stylesheet",
   type: "text/css",
   href: "styles/yourcss.css"
}).appendTo("head");
Starx
A: 

For collection of CSS/JavaScript import (including):

Eval alternative:

$("<script></script>", {type: "text/javascript",})
.text("alert('your function');")
.appendTo("head");

Embedded CSS:

$("<style></style>", {type: "text/css",})
.text("#you{css:rule}")
.appendTo("head");
deerua