Open thasmo opened 11 years ago
If I use "forceHashRouting: true" the hash routing works well in IE10 (which actually supports history state), but IE < 10 (IE9, IE8) still don't work with hash routing. :(
Using "window.location.hash = 'foobar'" to update the hash works in IE < 10 and also triggers the correct route when using the hash routing plugin. Just when clicking on a link the hash doesn't get updated - instead it will load the requested path (pagereload) and then triggers the route.
I found the problem. It seems IE < 10 returns the hostname AND the port when using "elem.host". So the check return elem.host !== window.location.host
will always fail. I've updated it to use return elem.host.split(':')[0] !== window.location.host
which seems to work in IE8 and IE9; they both return hostname:80
.
Thasmo, So does Davis now fallback to the hash if the browser doesn't support the History API? Can you provide any more details as I'm looking at this same issue. Thanks!
davis.hashRouting.js
Hi everyone,
If i refresh the page, an extra # is included in the url and page is not getting rendered. could anyone help me with hash routing in davis js.
Hi there!
I'm using the hash routing plugin for IE < 10 and I'm not sure if it's working like it should. Whenever I click a link in my app, the whole URL gets updated instead of the hash only. After the URL changes (and the page gets reloaded) Davis.js updates the hash with the current URL, because I've set "normalizeInitialLocation" to "true".
So in my oppinion when clicking a link Davis.js should only update the hash and trigger the routing - no?
Or is it absolutely needed to set links in my app with a prepended "#" in the href attribute? What I thought is that Davis.js would catch the click and updates the hash if the browser doesn't support history state.
Is there a way to get Davis.js working to update only the hash or am I doing something wrong anyway? Is there any example somewhere to look that up?