Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I love the structure of the site. You start at the top, and drill down to what you want. Maybe I've been using Unix too long... :-) "

Geography

Where in the world do Tek-Tips members come from?

Diverting to low res page for mobile devices

audiopro (Programmer)
24 Oct 11 14:21
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 = "http://www.lowresversion.co.uk";
}
</script>
 

Keith
www.studiosoft.co.uk

feherke (Programmer)
25 Oct 11 2:42
Hi

No. The best way is to not create separate URLs for the same content. See the Responsive Web Design article on A List Apart about how to use CSS3 Media Queries to change the page design according to the display circumstances.

Note that mobile browsers are pretty new, so they all handle media queries well.
 

Feherke.

audiopro (Programmer)
25 Oct 11 3:10
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
www.studiosoft.co.uk

feherke (Programmer)
25 Oct 11 3:45
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 :

Quote (Wikipedia article on iPhone):

iPhone 4 and iPhone 4S has a resolution of 640 × 960 at 326 ppi

An alternative is what Google seems to do : if the Accept 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.

ChrisHirst (IS/IT--Management)
25 Oct 11 13:17
http://css-tricks.com/6731-css-media-queries/

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

spamjim (Instructor)
26 Oct 11 12:14
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.
spamjim (Instructor)
26 Oct 11 12:30

Quote:

If you want to detect mobile devices, the new iPhones will not be caught by that resolution test :

Quote:

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.

http://www.bushidodesigns.net/blog/mobile-device-detection-css-without-user-agent/

More about pixel doubling for iPhone 4:
http://www.mobilexweb.com/blog/iphone4-ios4-detection-safari-viewport
http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html
feherke (Programmer)
26 Oct 11 12:37
Hi

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

Feherke.

darryncooke (TechnicalUser)
26 Oct 11 17:44
Why not just make a separate site for mobile then mobile.url.com. Redirect to that if the device is mobile?

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

audiopro (Programmer)
27 Oct 11 10:13
I am still no wiser as to which is the best method. JS will ork with most mobiles but not all.

As for

Quote:


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
www.studiosoft.co.uk

feherke (Programmer)
27 Oct 11 11:35
Hi

Quote (Keith):

How do I detect it is a mobile?
One way is to use a huge regular expression generated by Detect Mobile Browsers.
 

Feherke.

darryncooke (TechnicalUser)
29 Oct 11 12:38
^ What he said.

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

audiopro (Programmer)
28 Jan 12 10:42
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
www.studiosoft.co.uk

audiopro (Programmer)
3 Feb 12 8:48
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
www.studiosoft.co.uk

feherke (Programmer)
3 Feb 12 8:55
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.

audiopro (Programmer)
3 Feb 12 9:32
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
www.studiosoft.co.uk

audiopro (Programmer)
4 Feb 12 4:59
I have been looking for an emulator but none of the ones I have tried so far has actually worked, anyone know of a working one?

Keith
www.studiosoft.co.uk

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close