代码描述:js检测终端设备。js检测苹果终端设备代码实例下载
在实际应用中,可能需要检测iPhone、iPod、iPad等设备,下面就通过代码实例简单介绍一下如何实现此功能。 代码如下:
<script> var Apple = {}; Apple.UA = navigator.userAgent; Apple.Device = false; Apple.Types = ["iPhone", "iPod", "iPad"]; for (var d = 0; d < Apple.Types.length; d++) { var t = Apple.Types[d]; Apple[t] = !!Apple.UA.match(new RegExp(t, "i")); Apple.Device = Apple.Device || Apple[t]; } alert( "Apple device? " + Apple.Device + "\\niPhone? " + Apple.iPhone + "\\niPod? " + Apple.iPod + "\\niPad? " + Apple.iPad ); </script>
请绑定手机号,在继续操作
注意:只有绑定手机以后,才可使用网站全部功能