按钮10秒后才可以点击

<!-- alimama_pid="mm_10029469_121618_2137337"; alimama_titlecolor="0000FF"; alimama_descolor ="000000"; alimama_bgcolor="FFFFFF"; alimama_bordercolor="E6E6E6"; alimama_linkcolor="008000"; alimama_bottomcolor="FFFFFF"; alimama_anglesize="0"; alimama_bgpic="0"; alimama_icon="0"; alimama_sizecode="23"; alimama_width=160; alimama_height=600; alimama_type=2; // -->

  1. < input name = "rulesubmit" id = "agree" class = "button" type = "submit" value = "我已阅读并同意以上条款" > < input type = "button" name = "return" class = "button" value = "不同意" onclick = "javascript:window.location='/opencms/index.html';" > </ div >
  2. </ form >
  3. < mce:script language = "javascript" > <!--
  4. varsecs = 10 ;
  5. varwait = secs *1000;
  6. document.bbrules.rulesubmit.value = "我已阅读并同意以上条款(" +secs+")";
  7. document.bbrules.rulesubmit.disabled = true ;
  8. for(i = 1 ;i < =secs;i++){
  9. window.setTimeout("update("+i+")",i*1000);
  10. }
  11. window.setTimeout("timerrun()",wait);
  12. functionupdate(num,value){
  13. if(num ==(wait/1000)){
  14. document.bbrules.rulesubmit.value = "我已阅读并同意以上条款" ;
  15. }else{
  16. printnr =(wait/1000)-num;
  17. document.bbrules.rulesubmit.value = "我已阅读并同意以上条款(" +printnr+")";
  18. }
  19. }
  20. functiontimerrun(){
  21. document.bbrules.rulesubmit.disabled = false ;
  22. document.bbrules.rulesubmit.value = "我已阅读并同意以上条款" ;
  23. }
  24. //--> </ mce:script >
  25. 关于浏览器关闭的捕捉事件
  26. < mce:script language = javascript > <!--
  27. window.onbeforeunload = function ()
  28. {
  29. if(event.clientX> document.body.clientWidth&&event.clientY < 0 ||event.altKey)
  30. {
  31. window.event.returnValue = "" ;
  32. //yourcode
  33. }
  34. }
  35. //--> </ mce:script >
  36. 链接超时
  37. 把如下代码加入区域中:
  38. < mce:script language = Javascript > <!--
  39. tim = 1
  40. setInterval("tim++",100)
  41. b = 1
  42. varautourl = new Array()
  43. autourl[1]="www.njcatv.net"
  44. autourl[2]="javacool.3322.net"
  45. autourl[3]="www.sina.com.cn"
  46. autourl[4]="www.nuaa.edu.cn"
  47. autourl[5]="www.cctv.com"
  48. functionbutt(){
  49. document.write("< form )
  50. for(vari = 1 ;i < autourl.length ;i++)
  51. document.write("< input type = text +i+" size = 10 value =测试中…… > =》 < input type = text
  52. name =url "+i+" size = 40 > =》 < input type = button value = GO
  53. onclick = window .open(this.form.url"+i+".value) >
  54. ")
  55. document.write("< input type = submit value =刷新 > </ form > ")
  56. }
  57. butt()
  58. functionauto(url){
  59. document.forms[0]["url"+b].value = url
  60. if(tim> 200)
  61. {document.forms[0]["txt"+b].value = "链接超时" }
  62. else
  63. {document.forms[0]["txt"+b].value = "时间" +tim/10+"秒"}
  64. b++
  65. }
  66. functionrun(){for(vari = 1 ;i < autourl.length ;i++)document.write("
  67. onerror = auto ("http://"+autourl+"") > ")}
  68. run()
  69. //--> </ mce:script >
  70. 解决内存泄漏的问题。
  71. < mce:script language = "javascript" > <!--
  72. functionsendRequest(url)
  73. {
  74. url+=(url.indexOf("?")==-1?"?":"&")+"timestamp ="+newDate().getTime();
  75. req = new ActiveXObject("Microsoft.XMLHTTP");
  76. req.open("GET",url,true);
  77. writeStuff('Opening'+url);
  78. req.onreadystatechange = function (){
  79. writeStuff('readyStateisnow'+req.readyState);
  80. }
  81. req.send(null);
  82. writeStuff('Sendingrequest');
  83. }
  84. functionwriteStuff(msg){
  85. log.innerHTML+=msg+"< br > ";
  86. }
  87. //--> </ mce:script >
  88. < body onload = "sendRequest('http://www.hack58.com');" >
  89. < div id = "log" > </ div >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值