Copie o código do código da seguinte forma:
// Determina se é um ambiente operacional móvel
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent ))){
if(window.location.href.indexOf("?mobile")<0){
tentar{
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
// Se o ambiente de acesso for Android|webOS|iPhone|iPod|BlackBerry, carregue o seguinte estilo
setActiveStyleSheet("style_mobile_a.css");
}
senão if(/iPad/i.test(navigator.userAgent)){
// Se for determinado que o ambiente de acesso é iPad, carregue o seguinte estilo
setActiveStyleSheet("style_mobile_iPad.css");
}
outro{
// Se for determinado que o ambiente de acesso são outros dispositivos móveis, carregue os seguintes estilos
setActiveStyleSheet("style_mobile_other.css");
}
}
pegar(e){}
}
}
outro{
// Se nenhuma das opções acima, carregue os seguintes estilos
setActiveStyleSheet("style_mobile_no.css");
}
//Carrega o estilo após a conclusão do julgamento
função setActiveStyleSheet(nomedoarquivo){document.write("<link href="+nomedoarquivo+" rel=folha de estilo>");}