思路话语

。Arlen:思想有多远你就能走多远...

javascript:只有“是”“否”的对话框及其它

 

 1//以下代码即为只有“是”和“否”的对话框
 2//将其中的4改为其它的将会有不同的效果,例如终止、重试、忽略 ;确定、取消 ;等等
 3<script>
 4  /*@cc_on   @*/   
 5  /*@if   (@_win32   &&   @_jscript_version>=5)   
 6  window.confirm   =   function(str)     //Author:   meizz   
 7  {   
 8          str=str.replace(/\'/g,   "'&chr(39)&'").replace(/\r\n|\n|\r/g,   "'&VBCrLf&'");   
 9          execScript("n   =   msgbox('" + str + "',4,'自定义的confirm')","vbscript");   
10          return(n   ==   6);   
11  }   
12  @end   @*/
 
13//alert(confirm('1.\'第一行\';\r\n2.第二行;\r\n')); 
14confirm('xxx');
15</script>

 

posted on 2006-09-12 13:19  Arlen  阅读(733)  评论(0编辑  收藏  举报

导航