Tuesday, July 13, 2010

simple detect iphone browser

script
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "/mobile/";
}
/script

No comments: