Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Diverting to low res page for mobile devices

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
0
0
GB
I am setting up a page redirect to a low res version of a web page suitable for a mobile device, is this the best way to do it?

Code:
<script type="text/javascript">
if(screen.width < 600){
window.location = "[URL unfurl="true"]http://www.lowresversion.co.uk";[/URL]
}
</script>


Keith
 
I can't help but think that this 1 size fits all idea is great in theory but not in practice.

I find it interesting that while more and more people are browsing the internet on tiny screens, TV screens are just getting bigger and bigger.
The content of the 2 sites would have to be different. The full size version contains several Flash applications which are over 1000px wide so clearly they could not be used on the mobile version.
The client wants the mobile site to be much smaller with a couple of info pages and a contact form.

Keith
 
Hi

Well, then the use of your script sounds justified. But depending on what exactly you want to detect, it can be weak.

If you want to detect mobile devices, the new iPhones will not be caught by that resolution test :
Wikipedia article on iPhone said:
iPhone 4 and iPhone 4S has a resolution of 640 × 960 at 326 ppi

An alternative is what Google seems to do : if the [tt]Accept[/tt] HTTP request header contains "application/vnd.wap.xhtml+xml", then serves the mobile-specific version. For those using a browser which has that MIME type hard coded ( older Uzbl had it ), this method is quite irritating. Not sure how reliable this test is, just mentioned it.


Feherke.
 
That js will not allow you to offer a link on the mobile version to access the full size site. That is a preference that some users may want.

The js will just kick the user back to the mobile version unless you also add a check for a cookie for site preference.
 
If you want to detect mobile devices, the new iPhones will not be caught by that resolution test :
Quote (Wikipedia article on iPhone):
iPhone 4 and iPhone 4S has a resolution of 640 × 960 at 326 ppi

I have not tested with js but the CSS from this guy works on the higher resolution iPhone 4 by only specifying 480px. I believe the iPhone 4 uses some pixel doubling in its math to accommodate all the web sites already defined at 480px.


More about pixel doubling for iPhone 4:
 
Hi

Possible. I did not really understood to whom they intend to lie with that fake pixel thing.


Feherke.
 
I am still no wiser as to which is the best method. JS will ork with most mobiles but not all.

As for
Why not just make a separate site for mobile then mobile.url.com. Redirect to that if the device is mobile?

How do I detect it is a mobile?

Keith
 
Looking at that, the default is the mobile version and it is only redirected if none of the detect statements are true.

Out of interest .......
If I made the default version the mobile one and redirected if the screen res > 1000px, would that work?
This would still fall over if the visitor has JS turned off.

Seems that with every advance of technology there has to be a similar level of jiggery pokery to make it work properly.

Keith
 
The other problem with these pesky mobile devices is how much they are zoomed. Is there a suggested font size or is that another bit of guesswork?

Keith
 
Hi

No idea if this answers anything, just remembered it while reading your question and it presents normalization solution for text sizes. A Pixel Identity Crisis by Scott Kellum.

Feherke.
 
Thanks fot that interesting article but as you suggest, it doesn't really answer anything.

I don't really see why this is so complicated, it is surely a matter of being able to read text on screen. From the examples I have seen, the maximum number of characters across the screen at a readable size is about 40.
This does of course look ridiculous when you zoom in but I suppose we have to start somewhere.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top