olivernn/davis.js — Issue #24: hashRouting does not work in IE8 when using html5 doctype
Author: jacobcoens
Created: 2011-12-07 12:31:00+00:00
State: open

In Internet Explorer 8, when using the html5 doctype and not specifying a document compatibility mode (by using the "X-UA-Compatible" header or meta-tag), hashRouting does not work. This is because in this situation, IE renders the page in Quirks mode and therefore does not support the hashChange event, even though the browser reports that it does. Explanation: http://stackoverflow.com/a/4029796

In the extension, the check whether the onhashchange is supported (davis.hashRouting.js, line 87), should be extended with the a check whether the Document Compatibility mode if IE is at least 8 (Document compatibility modes: http://msdn.microsoft.com/en-us/library/cc196988.aspx) so that it falls back to polling if it isn't.

Sample code to determine the Document Compatibility mode can be found here: http://msdn.microsoft.com/en-us/library/cc288325.aspx#GetMode

Of course, you could also tell people to specify the document compatibility mode when using the html5 doctype ;-)