- 59
- 0
例如:
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 等等,都不是驼峰命名的
- 共 0 条
- 全部回答
-
当做那是梦 普通会员 1楼
The
onreadystatechangeevent is an event that is raised when a web page's state changes, such as when a form is submitted or when an AJAX request is completed. It is called in JavaScript, which is the programming language that is used to create and manipulate web pages. Theonreadystatechangeevent is triggered whenever the state of the page changes, and it has a single property calledreadyState. This property is an integer that indicates the current state of the event. For example, if the page has been loaded and thereadyStateproperty is equal to4, then the page has completed its loading process and is ready to be displayed. Theonreadystatechangeevent is called in JavaScript using theaddEventListenermethod, which is provided by the browser. TheaddEventListenermethod takes a function as an argument, which is called whenever thereadyStateproperty changes. This function is responsible for updating the content of the page or performing other actions based on the new state of the page. Theonreadystatechangeevent follows the camelCase convention because it is named after the property that is being changed. The convention is to capitalize the first letter of each word in a property name, except for the first letter of the word that is being added to the property name. For example, theonreadystatechangeevent would be namedonreadystatechangeProperty. In summary, theonreadystatechangeevent follows the camelCase convention because it is named after the property that is being changed. This convention is used in JavaScript to ensure that event handlers are properly named and organized, making it easier to understand and maintain the code.
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
