Below is my current script:
<script type="text/javascript">
if (navigator.userAgent.indexOf('BlackBerry')!= -1){
document.write('<link rel="stylesheet" href="/m/css/mobile.css" type="text/css" />');
} else if (navigator.userAgent.indexOf('iPhone')!= -1) {
document.write('<link rel="stylesheet" href="/m/css/smartmobile.css" type="text/css" />');
}else if (navigator.userAgent.indexOf('Android')!= -1) {
document.write('<link rel="stylesheet" href="/m/css/smartmobile.css" type="text/css" />');
} else if (navigator.userAgent.indexOf('Windows XP')!= -1) {
document.write('<link rel="stylesheet" href="/m/css/smartmobile.css" type="text/css" />');
}
else{
document.write('<link rel="stylesheet" href="/m/css/mobile.css" type="text/css" />');
}
</script>
The Windows XP is not working, and it's defaulting to the last else clause on a desktop computer. I need either the OS IDs or the browser's IDs (i .e firefox, chrome, IE, opera).