Go Back   CodingForums.com > :: Client side development > General web building > Building for mobile devices

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-25-2008, 05:14 PM   PM User | #1
cmxsevenfoldxmc
New Coder

 
Join Date: Jan 2008
Posts: 85
Thanks: 25
Thanked 0 Times in 0 Posts
cmxsevenfoldxmc is an unknown quantity at this point
How to determine if a visitor is using a phone or computer

Hi everyone,

Is it possible to determine at the startup of the page if the visitor is using a computer or a phone to access the site?

I would like to make the intro process much better than a simple "click here for HTML version or click here for Flash version". I would like for it to simply redirect to the page I set it to go to depending on whether or not they're using a regular browser or a mobile browser.

How would I go about this?

Thank you all very much in advance.
cmxsevenfoldxmc is offline   Reply With Quote
Old 07-25-2008, 06:17 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by cmxsevenfoldxmc View Post
Hi everyone,

Is it possible to determine at the startup of the page if the visitor is using a computer or a phone to access the site?
No, not possible.
Philip M is offline   Reply With Quote
Old 07-25-2008, 06:44 PM   PM User | #3
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
You could make a stylesheet for 'handheld' or for 'screen' but that would probably not work for sites made totally in flash. they aren't a good idea anyway so, this may be a solution for you.

bazz
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link
bazz is offline   Reply With Quote
Old 07-25-2008, 07:22 PM   PM User | #4
ohgod
Regular Coder

 
ohgod's Avatar
 
Join Date: Jun 2008
Location: Ohio
Posts: 579
Thanks: 6
Thanked 69 Times in 69 Posts
ohgod is on a distinguished road
well i would think that you'd be able to tell what browser they're using... and since phones use different browsers.......
ohgod is offline   Reply With Quote
Old 07-26-2008, 01:39 AM   PM User | #5
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,452
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
i think a better way would be to determine flash capability, and show the flash if it supports it, or the html if it don't.

also, i would think then a screen.width < 700 would be highly indicative of a mobile device: fewer than 1% of real browsers use 640X480. iphone is certainly lower

also, you could simply eliminate possibilies and assume a phone at the end.

assume the answer is no to all of these:
are you IE ? are you FireFox? are you Opera? are you Safari? (if yes, is your screen.width > 700)? you must be a phone!
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.8% IE9:11.4% IE10:6.5%

Last edited by rnd me; 07-26-2008 at 01:46 AM..
rnd me is offline   Reply With Quote
Users who have thanked rnd me for this post:
cmxsevenfoldxmc (07-28-2008)
Old 07-28-2008, 10:27 PM   PM User | #6
cmxsevenfoldxmc
New Coder

 
Join Date: Jan 2008
Posts: 85
Thanks: 25
Thanked 0 Times in 0 Posts
cmxsevenfoldxmc is an unknown quantity at this point
Thanks rnd me,

The screen width trick could work beautifully.

I will try to put that into shape.

I'll try a simple if...then procedure with that and see how it works.

Thanks again.
cmxsevenfoldxmc is offline   Reply With Quote
Old 10-11-2010, 12:38 AM   PM User | #7
Leprkawn
New Coder

 
Join Date: Oct 2010
Location: Like me, on a tiny speck of dust floating in the Virgo Cluster.
Posts: 29
Thanks: 1
Thanked 1 Time in 1 Post
Leprkawn is an unknown quantity at this point
Question href="tel" for mobile users only

Hello!

I have noticed a few Web sites where they make the href="tel:" tag work for mobile users, but it is not available via the computer.

So, how would I go about implementing something like this?

Please bear in mind that my javascript skills = noobish.

Many thanks!
Leprkawn is offline   Reply With Quote
Old 10-11-2010, 04:05 AM   PM User | #8
gizmo1650
Regular Coder

 
Join Date: Apr 2010
Posts: 163
Thanks: 3
Thanked 25 Times in 25 Posts
gizmo1650 is on a distinguished road
you could use navigator.platform this would require you to manual list the id of all the major browsers or phones
gizmo1650 is offline   Reply With Quote
Old 06-15-2011, 12:35 PM   PM User | #9
Bikercaz
New to the CF scene

 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Bikercaz is an unknown quantity at this point
Hi there,

Am I going mad here? I use

Dim BCaps As HttpBrowserCapabilities
Session("Width") = BCaps.ScreenPixelsWidth

On IE9 this gives me 640

If this is less that 700 as is suggested above then everything will be as for mobiles.

I also have issues with Safari as it doesn't work on my ASP.NET VB Menus.

What a nightmare!

Any help gratefully received.

Cheers
Bikercaz is offline   Reply With Quote
Old 06-15-2011, 02:23 PM   PM User | #10
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
The thread is old and obsolete. It is possible, with a high precision (not absolute, but high) to detect smartphones:

http://www.hand-interactive.com/reso...javascript.htm
http://www.hand-interactive.com/reso...mobile-php.htm
http://www.hand-interactive.com/reso...obile-java.htm
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:52 PM.


Advertisement
Log in to turn off these ads.