Detect iPhone/iPod Touch User Coming To Your Site
Posted in JavaScript, iPhone/iPod Touch on Jun 4th, 2008
Here is a quick way to detect users coming to your site using an iPhone/iPod Touch and to redirect them to your MOBILE version of your site.
The script should go between the HEAD section of your page. Just replace iphone-version.html with the URL of your MOBILE version of your site.
<script language=javascript>
<!–
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
location.replace("iphone-version.html");
}
–>
</script>
Once you got [...]
