Dec 15 2009

Add an iPhone & iTouch icon to your website

First Stategy:

Second Strategy:

Create an iPhone and iTouch icon for your website in two minutes

This might be one of the easiest tutorials, exercises or to-do’s on this site.

STEP 1

First create a 75 pixel by 75 pixel in png format if you haven’t done so already. Make sure this icon matched the images you want to portray for your website.

STEP 2

Rename the image apple-touch-icon.png

STEP 3

Upload the image to the root directory of your website

That’s it, for now on when anyone goes to your site on an iPhone or iTouch and bookmarks it, they will see your newly created icon on the device desktop.

Tags: , ,

Dec 15 2009

Redirect users to another page or sub domain when they come to your site from a mobile devices

First Stategy:

Second Strategy:

Redirecting users based on their browser to a mobile subdomain

Put this in the head of your web page

<script language="javascript" type="text/javascript">
function browserCheck() {
    var agt = navigator.userAgent.toLowerCase();
    if (agt.indexOf("windows ce") != -1) return true;
    if (agt.indexOf("palmsource") != -1) return true;
    if (agt.indexOf("palmos") != -1) return true;
    if (agt.indexOf("midp-") != -1) return true;
    if (agt.indexOf("portalmmm") != -1) return true;
    if (agt.indexOf("symbian os") != -1) return true;
    if (agt.indexOf("up.browser") != -1) return true;
    if (agt.indexOf("mobilephone") != -1) return true;
    if (agt.indexOf("nokia") != -1) return true;
    if (agt.indexOf("docomo") != -1) return true;
    if (agt.indexOf("blackberry") != -1) return true;
    if (agt.indexOf("iphone") != -1) return true;
    if (agt.indexOf("ipod") != -1) return true;
    if (agt.indexOf("itouch") != -1) return true;
    else return false;
}
 
var browserName = browserCheck()
if (browserName) {
    document.location = "http://mobile.secondstrategy.com";
} else if (screen.width <= 699) {
    document.location = "http://mobile.secondstrategy.com";
}
</script>

Tags: , , , ,