标签:
1、
window.setTimeout(A, B);
window.clearTimeout(?);
2、
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 3 <html> 4 5 <style type="text/css"> 6 </style> 7 8 <script type="text/javascript" > 9 10 window.onload = function() 11 { 12 var t1 = window.setTimeout(Hello, 500); 13 var t2 = window.setTimeout("Hello()",1000);//使用字符串执行方法 14 //window.clearTimeout(t1);//去掉定时器 15 //window.clearTimeout(t2);//去掉定时器 16 17 var zz = new Tzz(); 18 window.setTimeout(zz.SayHi, 500); 19 window.setTimeout(Tzz.prototype.SayHi01, 500); // ZC: 没有任何反应 20 window.setTimeout(zz.SayBye, 500); 21 window.setTimeout(Tzz.SayBye01, 500); // ZC: 没有任何反应 22 23 Tzz.prototype.SayHi01.call(window); 24 }; 25 26 function Hello() 27 { 28 console.log("hello"); 29 } 30 31 function Tzz() 32 { 33 this.SayHi = function() 34 { 35 console.log("Hi"); 36 }; 37 this.SayHi01 = function() 38 { 39 console.log("Hi01"); 40 }; 41 } 42 43 Tzz.prototype.SayBye = function() 44 { 45 console.log("Bye"); 46 }; 47 Tzz.prototype.SayBye01 = function() 48 { 49 console.log("Bye01"); 50 }; 51 52 </script> 53 54 <div id="div01"> 55 </div> 56 57 </html>
3、
标签:
原文地址:http://www.cnblogs.com/h5skill/p/5281415.html