To load a CSS file asynchronously with jQuery while providing a callback function for when the file has been included, use the following code:
var stylesheet = "foo.css";
var callback = function(){
alert("CSS is now included");
};
$.get(stylesheet, function(contents){
$("<style type=\"text/css\">" + contents + "</style>").appendTo(document.head);
callback();
});
Some truly prime articles on this site, saved to fav.