判断手机端还是ipod还是PC(整理)


function thtg() {
	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) {

			try {

				if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {

					//                 window.location.href="http://www.baidu.com";
					// 手机
					$("#hl-selected .itemDiv .item").css("padding-top","0");
					$(".itemAdd").css("margin-top","0");
					$(".itemAddCounter").css("margin-top","0");


				} else if (/iPad/i.test(navigator.userAgent)) {

				} else {

					//                 window.location.href="http://api.touchtao.tech/poetry/index.html?token=cjxt-apieyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyODczYmI3ZDhjMmFhNTlmIiwidWlkIjoxNzIsImNyZWF0ZWQiOjE2MDUyNTQwMDE4OTUsIm5hbWUiOiLku5PpoonlrabloIJfM0ZHWTJKOWtQZCIsImV4cCI6MjIzNTk3NDAwMX0.9Klw6DLREk54lx0hyDp7khKdDFZ5g-4OI8Nn973HA3ieU75rvSJNaZvK1HAjm-pZMo8eJl5gV_EDoiiFA6NbDQ&id=657&typeNum=2";

				}

			} catch (e) {}

		}

	}
}
thtg()

转载-忘记用哪个博主的文章-感谢分享

上一篇:【差分约束/拓扑+缩点】[SCOI2011]糖果 (差分约束的复习)


下一篇:centos7下dotnet 命令不存在