why onreadystatechange doesn't follow the camelCase convention?

hard
  • 22

例如:

var xhr = new XMLHttpRequest();

xhr.onreadystatechange = function () {
      if (xhr.readyState === 4) {
          document.getElementById('ajax').innerHTML = xhr.responseText;
      }
};

notice xhr.onreadystatechange is not camelCased but xhr.responseText is. Is there a reason for this that I've missed?
还有诸如:onmousedown/onmouseup 等等,都不是驼峰命名的

回复
阅读 866
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏