Load external css file like scripts in jquery which is compatible in ie also

Posted by Starx on Stack Overflow See other posts from Stack Overflow or by Starx
Published on 2010-04-21T18:38:06Z Indexed on 2010/05/13 6:24 UTC
Read the original article Hit count: 207

Filed under:
|

Is there a way to load external CSS files, like we load JS file by using .getScript method and also use the callback function like in .getScript

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

This Works in FireFox and similar but not in IE.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ajax