jQuery add stylesheet dynamically

within some logic, a function, elsewhere :

var link = $(“<link>”);
link.attr({
type: ‘text/css’,
rel: ‘stylesheet’,
href: ‘css/contentslider2.css’
});
$(“head”).append( link );

Comments are closed.