js 常用处理
判断浏览器环境是PC端还是手机端
function goPAGE() { 2 if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { 3 window.location.href=" ";//手机端 4 } 5 else { 6 window.location.href=" ";//PC端 7 } 8 } 9 goPAGE();
js url传参编码和解码 tag = encodeURI(tag);//编码 decodeURI(tag)//解码