• 0

iWebkit question


Question

I had developed a website for the iphone using iwebkit, now my question is how I can implement this site in an existing website and add that existing website a scripting code in which it will tell the full version website that if someone is using an iPhone it will change the regular website into the mobile version that I did? iWebkit does not explain how to do this. It is basically the way Neowin works, if someone is using a regular computer you will watch the full version, if someone visit Neowin with an iphone or any other mobile device it will change to Neowin Mobile.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Most sites use php/asp to check the User Agent, and if it's a handheld device switch to a different template / redirect to a different area of the site for that device. I've done it with a few sites. There's several PHP scripts out there to check useragesnts, some even designed around mobile devices ( http://www.hand-interactive.com/resources/detect-mobile-php.htm being the one I use more often than not )

Link to comment
Share on other sites

  • 0

Thanks guys but my website does not use php. I found this script:

<script language=javascript>
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
location.href='http://iphone.refreshedweb.com';
}
-->
</script>

Works like a charm!

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.