How to – detect iPhone with Java-script
Here is a javascript code snippet that will help you detect iPhone
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
if (document.cookie.indexOf("iphone_redirect=false") == -1) {
window.location = "http://website.com/iphone";
}
}
| Print article | This entry was posted by admin on April 23, 2010 at 6:15 am, and is filed under How to guides, Snippets, Tutorials. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
