I'm wondering which is best for speed:
Option 1: Loading separate CSS for each browser (separate JS file included through a <script/>
):
// for internet explorer 6 & 7
if ($.browser.msie) {
document.write('<link rel="stylesheet" type="text/css" href="/css/styles-ie.css" />');
}
// for opera
if ($.browser.opera) {
document.write('<link rel="stylesheet" type="text/css" href="/css/styles-opera.css" />');
}
Option 2: Inline CSS (separate JS file included through a <script/>
):
// for internet explorer 6 & 7
if ($.browser.msie) {
document.write('[some CSS styles]');
}
// for opera
if ($.browser.opera) {
document.write('[some CSS styles]');
}
Option 3: Or is there another better way?