I am working on a page that needs to detect the browser being used (Chrome, Firefox, IE, Safari, Opera) and accordingly set a flag value from say 1 to 5 using which I want to change the source of my image tag (basically I want to display the icon image depending on the browser being currently used).
I need to this using jQuery. My initial choice was js but I guess it's not a very reliable option given that some users turn off scripts while browsing and it's possible to modify the user agent of browsers such as Opera in the Settings. Correct me if I am wrong.
Can someone please help me with the code?
Edit: The reason I am asking this question again is that other duplicate questions talk about best practices and the use of $.support vs $.browser for detection but as I understand it, $.support only checks for opacity support. Is it able to indicate exactly which browser is being used? My task of displaying the appropriate logo is very specific that needs to check only the browser name (not even the version). How can I accomplish this?