I have this simple html code below. It works as expected (appending ?SomeParam to the url) in my development environment (Visual Studio 2010) in both Chrome and IE11. When I put this in an htm file on the web server, it works in Chrome, but in IE11 it gives "Object doesn't support property or method 'pushState'. I've searched this thoroughly and can only find that pushState is not supported in IE versions <= 9.0 but should be supported in IE10 and IE11.
Does anyone have any ideas?
<script language="javascript" type="text/javascript">
function test1() {
try {
window.history.pushState("abc", "", "/?SomeParam");
}
catch (err) {
alert(err.message);
}
}
</script>
<button id="button1" onclick="test1()">Test</button>
history
is a single DOM object in IE. Tryhistory.pushState
. – Reconcile