4

BROWSER: Edge 12.10158

Snippet:

window.history.replaceState({page: fragment},'','/demo/'+fragment);

This works in all other browsers as expected (including IE 11); However, when using this in Edge i get the error: unspecified error.

So naturally i wrote a conditional to return if the method exist.

return (typeof window.history.replaceState == "function")

This returns true, so the method replaceState is intended to be supported in MSEDGE.

What are some better alternative to test if this method is supported or not?

iv'e added hashbang to the tags because this is part of the hashbang technique and i'm sure others will face this issue in the future.


UPDATE: This solves the unspecified error, but i would prefer not to emulate.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
THE AMAZING
  • 1,496
  • 2
  • 16
  • 38

0 Answers0