I’m implementing history API for my web app and of course IE doesn’t support it. That’s fine, I have a work around for it but when I test to see if there’s support for the API, I’m not getting the expected result.
This is the offending line:
if (window.history) {
The problem is that in IE, it shows as true. Why?
Simple. IE does support some history stuff, for instance
window.history.back(). You need to test for a more specific method or property of the history API. Try this: