I want to use jQuery to asynchronously load CSS for a document.
I found this sample, but this doesn't seem to work in IE:
<script type="text/javascript" src="/inc/body/jquery/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
$(function(){
$('<link>', {
rel: 'stylesheet',
type: 'text/css',
href: '/inc/body/jquery/css/start/jquery-ui-1.8.10.custom.css'
}).appendTo('head');
$.getScript("/inc/body/jquery/js/jquery-ui-1.8.10.custom.min.js", function(){
});
});
</script>
Basically I want to load jQuery UI
after the all other data, images, styles, etc load to the page.
The $.getScript
works great for JS file. Only problem is with CSS in IE.
Do you know a better solution?