Is there a way to detection if a user is on a mobile device using just coldfusion only?
- I’m not doing a mobile redirect.
- I am using CSS media queries to change the layout to fit screen width.
- I just want to do a simple if mobile render this information else render this information instead to parts of the site not the whole thing. (ex: if mobile [show jquery animation] else show [link])
- I don’t want to waste time rendering both if only to do a display none to the info not going to be shown anyways.
- No javascript mobile detection (people might have javascript off on their browsers)
I wrote a blog entry about this very thing!
http://www.mccran.co.uk/index.cfm/2010/6/4/Simple-Coldfusion-script-to-detect-if-a-user-is-on-a-Mobile-platform
You can easily detect the browser from the user agent string. Tho as I’ve experienced recently browsers like chrome will allow you to change your user agent string:
http://www.mccran.co.uk/index.cfm/2011/9/25/Samsung-Galaxy-Tab-101-Switching-your-browser-from-mobile-view