Showing posts with label CSS3. Show all posts
Showing posts with label CSS3. Show all posts

Sunday, March 16, 2008

Client Side iPhone / iPod Touch Browser Redirect

If layer 7 redirection from hardware based solutions isn't quite available in your enterprise, or perhaps the entire CSS3 standard hasn't completely made it into your long term memory yet there is a very easy way to redirect iPhone & iPod Touch users.

While several of our clients have experience varying levels of success, small to mid-sized solutions may benefit from a simple inline javascript redirect.

Example:

<script language=javascript>

<!--

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))

{

location.replace("http://TYPE_YOUR_URL_HERE");

}

-->

</script>




Those who are better versed in conditional CSS, will find that the iPhone
and iPod Touch react very favorably to a CSS that is optimized to the
specifications referenced by Apple in the developer documentation on their
site (Apple Developer Connection Guides).


-Robert Zullo