How To Make JavaScript Detect For iPhone iPod
Below is an example of how you would detect the User Agent for the iPhone & iPod, therefore redirecting the browser.
Code Example:
<head>
<style type="text/css">
.header{width:200px;height:100px;background:#f00;}
</style>
<script language="javascript" type="text/javascript">
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{location.href='http://www.combsconsulting.com//iphone/';}
-->
</script>
</head>
<body>
<div class="header"></div>
</body>
</html>
Explanation:
The nuts and bolts of the script work as follows: The script says if the "navigator.userAgent" (The Browser) ".match(/iPhone/i)" (Is Running On A iPhone), or "navigator.userAgent" (The Browser) ".match(/iPod" (Is Running On A iPod), then "{location.href='http://www.combsconsulting.com/iphone/';}" (Redirect The Browser To http://www.combsconsulting.com//iphone/ ).

Note: If you need to no How To Hide URL On iPhone iPod, How To Make A Java Script Detect For iPhone & iPod, or How To Make Apple Touch Icon Favicon For iPhone iPod see the links below.
See:
How To Hide URL On iPhone iPod
How To Make Java Script Detect For iPhone & iPod
How To Make Apple Touch Icon Favicon For iPhone iPod
