Reputation: 11
I have an issue where our website will only support Internet Explorer version 9 and above. Originally I had checked the user agent string to obtain the browser and version and redirect but have found this to be an unusable solution. Our network automatically changes the user agent string to ie 7 compatibility mode even if using ie 11.
I have found that using java script I can check the document mode, which is successfully returning the correct mode requested even with compatibility mode enabled.
Rather than just redirecting based on the document mode is there way I can get the actual browser version even if compatibility mode is on as a redirect may not be required if the browser is ie 9 or above but in compatibility mode.
The idea is to check if the browser supports edge and change the response to edge and this should still be rendered but redirect if this is not possible ?
I want to avoid redirecting a user on ie 11 with compatibility mode enabled as they may not know how to change this setting.
Any help would be appreciated.
Thanks
Upvotes: 1
Views: 714
Reputation: 23
The way I have gone about this in the past, if I couldn't use the user agent for some reason, was to do it with feature detection.
https://msdn.microsoft.com/en-us/library/hh273397(v=vs.85).aspx
It's important to decide why you need to know the browser version. Look for browsers that can't support whatever you're trying to do, and redirect them.
Upvotes: 0