Geek Out!

live.pirillo.com

More Information

How To Redirect An iPhone or iPod touch To A Mobile Version of Your Site

This is a simple Javascript that will redirect an incoming iPhone or iPod touch to your website:

<script type="text/javascript">
var platform = navigator.platform.toLowerCase();
if(platform == "ipod" || platform == "iphone")
{
window.location="http://yoursite.com/mobile/";
}

else
{
window.location="http://yoursite.com/";
}
</script>

Views: 10

Tags: HTML, Javascript, Safari, a, an, how, iPhone, iPod, mobile, of, More…or, redirect, site, to, touch, version, website, your

Comment

You need to be a member of Geeks to add comments!

Join Geeks

Comment by Gavin Roskamp on August 5, 2010 at 12:11pm
Awesome! Thanks for posting!

© 2012   Created by Chris Pirillo.

Badges  |  Report an Issue  |  Terms of Service