首页 > 代码库 > 判断是手机用户还是pc用户

判断是手机用户还是pc用户

<script language="JavaScript" type="text/javascript">  	{  			if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)){		window.location.href=http://www.mamicode.com/‘phone.html‘;>

 

判断是手机用户还是pc用户