Skip to main content
Known Participant
November 7, 2008
Question

Browser Detection

  • November 7, 2008
  • 3 replies
  • 768 views
Is there a way to detect the browser the user has when the page loads in Coldfusion? sample would be a big help. thanks.
This topic has been closed for replies.

3 replies

Inspiring
November 7, 2008
it's one of the cgi variables.
Inspiring
November 7, 2008
TheScarecrow wrote:
> Is there a way to detect the browser the user has when the page loads in Coldfusion? sample would be a big help. thanks.

User agent strings can be parsed to make a best guess at browser.

Just be aware that there are a large host of host headers out there.
http://www.user-agents.org/


Also be aware that browsers can be configured to hide what they are.
Just look at Firefox's 'User Agent Switcher'.

http://en.wikipedia.org/wiki/User_agent

Known Participant
November 7, 2008
Is there a way to detect the browser version number?
Inspiring
November 7, 2008
do you mean detect it by CF or in general?
in general - use one of a multitude of browser sniffing js scripts;
in CF - look at #cgi.http_user_agent# - look at the available js scripts
and which parts of the useragent string they process to determine the
browser and write a cf script to do the same.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/