Here is my code:
<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>
Clearly my Windows XP one is wrong. Anyone know what I need to replace it with so that the /css/mobile.css only shows up on phones other than the iPhone and Android devices.
Whether I need to add Linux and Windows or all the popular browsers instead of OS