3

According to MDN here and here, it says that the readystatechange event is supported in all browsers, but the document.readyState property is only supported back until around IE9+ (8*).

This doesn't really make sense, given that literal definition of the readystatechange event is:

The readystatechange event is fired when the readyState attribute of a document has changed.

Unless previous implementations of readystatechange keep document.readyState as an internal variable that can't be accessed. Is this the case, or is this simply a documentation error?

Kithraya
  • 358
  • 2
  • 10

1 Answers1

1

It looks like a documentation error. I try to test the document.readyState property in IE 11 with different document modes and it works in all the document mode so similar should works in all the versions of IE.

Tested code:

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the loading status of the current document.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
  var x = document.readyState;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Output:

enter image description here

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19