「javaScript入門」PCとスマホデバイスに切り替える判断コード
JavaScriptコード:
var devUt= navigator.userAgent;
var redUrl = '/sp/index.html’;
if(devUt.search(/iPhone/) != -1 || devUt.search(/iPad/) != -1 || devUt.search(/iPod/) != -1 || devUt.search(/Android/) != -1){
location.href = redUrl;
}