Detecting IE8 operating in IE7 mode

Detecting IE8 operating in IE7 mode


Hello everybody,
I'm aware that jQuery promotes features detection over browser
sniffing but currently we provide no way for the user to figure out
easily when the browser is IE8 operating in the so called
"compatibility mode".
To detect that case the following line could be used:
document.documentMode && document.documentMode == 7;
What to do with that knowledge then? I'm not sure if it's a good idea
to replace $.browser.version with 7, since some new JavaScript
features introduced in IE8 are still available in compatibility mode
(XDomainRequest for example).
We could add a new property to the $.browser object, for example:
$.browser.mode = 7
What do you think?