js 中确定与取消 和 是 否的 抉择

javascript JS 中confirm 确定 取消 按钮替换成 是 否 取消

通常用js 中confirm实现弹出对话框确定取消

<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--> < script language ="Javascript" >
function preview()
{
var bln = confirm( " 需要打印签核流程吗? " )
if (bln == true )
{}
else
{}
}
</ script >

有的时候需要把 “确定”“取消” 替换成 “是” “否” “取消”

<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--> < SCRIPT LANGUAGE ="vbscript" >
function show(str)
show
= msgbox (str, 3 , " 提示 " )
// 6
// 7
// 取消 2
end function
</ SCRIPT >

< script language ="Javascript" >
function preview()
{
var bln;
bln
= show( " 是否要将签核过程打印在页面后? " )
switch (bln)
{
case 6 :
SignTR.className
= '' ;
break ;
case 7 :
SignTR.className
= ' NOPRINT ' ;
break ;
case 2 :
return ;}
}
</ script >

如果用上language=vbscript 当鼠标划过menu的时候网页左下角会出错,如果改成javascript就OK 了

<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--> < script language ="Javascript" >
function show(str)
{
execScript(
" n=msgbox(' " + str + " ',3,'提示') " , " vbscript " );
return (n);
}
</ script >

只有“是”“否”,还有其他情况可参考vbscript的msgbox

<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--> < script language =javascript >
function window.confirm(str)
{
execScript(
" n=(msgbox(' " + str + " ',vbYesNo,'自定的confirm')=vbYes) " , " vbscript " );
return (n);
}
alert(confirm(
" 重载的confirm弹出框 " ));
</ script >

你可能感兴趣的:(js)