why onreadystatechange doesn't follow the camelCase convention?

例如:

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 等等,都不是驼峰命名的

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