摘要:
1.先写一个错误的例子: function DealSomething() { //write some code window.setTimeout(function () { alert("已经等待超过10分钟,自动关闭页面。"); }, 600000); }这个例子的行为:不管是否处理完,超过10分钟后,都弹出这个alert框来。2.再看另一个错误的例子,这次使用了clearTimeout函数来清除setTimeout。 function DealSomething() { //write some code var Timer =window.setTimeout( 阅读全文