I am currently developing a client side application which will be designed for both, smartphones and tablets. Therefore it will get two different layout modes.
While th
+1 for testing screen resolution rather than user agent (and iPhone vs iPad is a very simplistic test anyway—what about all those other tablet devices??)
In terms of testing for iPhone 4, i.e. retina displays, this test should work in your Javascript:
if(window.devicePixelRatio > 1){
// Retina device...