Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fig

macrumors 6502a
Original poster
Jun 13, 2012
916
84
Austin, TX
Hey folks, wondering if anyone has any good resources or scripts for mobile detection?

I've used a few in the past that have worked, and currently I'm finishing up a project that will have a one page mobile site and a full standard site. I'd like to have an option for the mobile user to view the full site after initially being directed to the mobile site, but I'm trying to figure out how to keep them from being redirected back to the homepage (ideally without building a redundant set of pages for them to be directed to).

Any ideas? Thanks, appreciate it.
 

960design

macrumors 68040
Apr 17, 2012
3,700
1,569
Destin, FL
Add a session variable.

Something like mobile = false. Have your magic script detect mobile and change mobile = true.

Allow the user to click a button that changes the mobile = true back to false. Have the user check as an if statement surrounding the mobile script detection. At the very top default the user selection to false.

Wow, It may actually be easier to put this in code instead of pseudo.
 

fig

macrumors 6502a
Original poster
Jun 13, 2012
916
84
Austin, TX
Add a session variable.

Something like mobile = false. Have your magic script detect mobile and change mobile = true.

Allow the user to click a button that changes the mobile = true back to false. Have the user check as an if statement surrounding the mobile script detection. At the very top default the user selection to false.

Wow, It may actually be easier to put this in code instead of pseudo.

Got it, I'm with you in theory.

A friend gave me http://mobiledetect.net/ to check out which looks like it does a nice job of detection, just need to figure out how to integrate the variable idea.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.