Skip to content


Subversion checkout URL

You can clone with
Download ZIP


hashRouting does not work in IE8 when using html5 doctype #24

jacobcoens opened this Issue · 3 comments

2 participants


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:

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: so that it falls back to polling if it isn't.

Sample code to determine the Document Compatibility mode can be found here:

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


I think that using the html5 doctype and not specifying a document compatibility mode is something that people are likely to do, so this is something that should be fixed. The change doesn't look to big, I'll put together a fix and put it into the next release.


Sorry for the delay on this. I am trying to re-create the issue but don't seem able to. I have the following code:

<!DOCTYPE html>

<script src="/examples/jquery.js" type="text/javascript" charset="utf-8"></script>

<script src="/lib/davis.js"></script>
<script src="/lib/davis.history.js"></script>
<script src="/lib/davis.location.js"></script>
<script src="/lib/extensions/davis.hashRouting.js"></script>
<script src="/lib/davis.utils.js"></script>
<script src="/lib/davis.listener.js"></script>
<script src="/lib/davis.event.js"></script>
<script src="/lib/davis.logger.js"></script>
<script src="/lib/davis.route.js"></script>
<script src="/lib/davis.router.js"></script>
<script src="/lib/davis.request.js"></script>
<script src="/lib/"></script>

  Davis.extend(Davis.hashRouting({forceHashRouting: true}))

  app = Davis(function () {
    this.get('/foo', function () {

<a href='/foo'>Foo!</a>

But the hash routing seems to be working correctly. I even tried forcing IE8 into compatibility mode using <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> but the hashRouting was still working for me?

Do you have an html snippet that I can use to re-create the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.