如果想簡單判斷,並跳轉,用下面代碼就可以:
- n$ f. c# r. [! T[mw_shl_code=javascript,true]if( /Android|webOS| iPhone | iPad | iPod |BlackBerry|opera mini|opera mobile|appleWebkit.*mobile|mobile/i.test(navigator.userAgent) ) {+ Q! M. ]9 B; _9 R b0 S7 _/ ]6 P
window.location = 'wap.html';
# n: I& }5 r3 m+ O}[/mw_shl_code]7 C4 o. E' J7 l9 o% Q$ ]
0 n* ]" F- N3 U! A- U% I |