关于Ajax的多个请求的问题
当我们用Ajax请求数据时,可能会遇到多次单击触发器的可能性。(例如,AJAX onreadystatechange事件触发了许多倍;这是因为onreadystatechange是事件处理。
它的价值(state_change)是一个功能的触发功能的XMLHttpRequest对象的状态发生变化时。
0状态变化(初始化)到4(完全)。只有当国家是4,我们执行的代码。
这个功能是触发每次XMLHttpRequest对象的状态变化。
它会触发4次,从0到4。ps:当然,这里引用的例子与工作中遇到的问题不完全一致。}此时我们需要一种终止程序的方法。
退出和中止都是用来终止程序的函数,让我们来看看这两个程序之间的区别。
Exit will do some release work: release all static global objects, cache, turn off all I/O channels, and then terminate the program.If a function is registered by atexit, the registered function is also called.However, if the atexit function is thrown out of the exception, the terminate is called directly.
终止:立即终止程序,没有任何清理工作。
以上是您对ajax的多个请求的全部内容,希望您能给予更多支持。