写移动端流氓方法,无意看到,分享下

<scrpit>

window.onload = function () {
var u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
          alert("安卓手机");
      } else if (u.indexOf('iPhone') > -1) {//苹果手机

alert("苹果手机");
} else if (u.indexOf('Windows Phone') > -1) {//winphone手机
alert("winphone手机");

}
}
</script>
原文地址:https://www.cnblogs.com/tk900123/p/5464676.html