我有一个脚本来检测用户是否使用移动设备:
<script type="text/javascript">
//<![CDATA[
var mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) || (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) {
window.location.href = 'http://www.site.com/mobile/';
}
//]]>
</script>
但是我明白了,||有什么问题?
Uncaught SyntaxError: Unexpected token ||