IIS跳转html页面自动识别是PC端还是手机端
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript"> window.onload=function() { try{ if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { alert('iPhone'); window.location.href="../Mobile/Login.aspx"; }else{ alert('pc'); window.location.href="../Login/Login.aspx"; } }catch(e){} } </script> </head> <body> </body> </html>
所有问题都会有一定程度的抽象和假设