JavaScriptで単純なスマートフォン分岐。
タブレットはスマートフォン版を表示する場合。
PCからスマートフォンに分岐
if (navigator.userAgent.indexOf('iPhone')>0 || navigator.userAgent.indexOf('Windows Phone')>0 || navigator.userAgent.indexOf('Symbian')>0 || navigator.userAgent.indexOf('BlackBerry')>0 || navigator.userAgent.indexOf('Android')>0 || navigator.userAgent.indexOf('MOBILE')>0){
setTimeout("link()", 0);
function link(){
location.href='/sp/';
}
}
スマートフォンからPCに分岐
if (navigator.userAgent.indexOf('iPhone')>0 || navigator.userAgent.indexOf('Windows Phone')>0 || navigator.userAgent.indexOf('Symbian')>0 || navigator.userAgent.indexOf('BlackBerry')>0 || navigator.userAgent.indexOf('Android')>0 || navigator.userAgent.indexOf('MOBILE')>0){
}else{
setTimeout("link()", 0);
function link(){
location.href='/';
}
}