Making iPhone Compatible Websites
The script itself goes as follows:
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/Android/i)))
document.write("<link rel=’stylesheet’ href=’css/mobile.css’ />");
document.write("<meta name=’viewport’ content=’width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no’>");
document.write("<link rel=’stylesheet’ href=’css/style.css’ />");
It should be noted that the Safari browser and Android’s native browser both support webkit libraries and much of CSS3.