怎么用javascript弹出警告框

bian8021 2002-05-13 04:53:49
怎么实现弹出“是”,“否”的选择对话框,并对应链接不同的网页。
...全文
220 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiushuiwuhen 2002-05-13
  • 打赏
  • 举报
回复
<script>
execScript('ret=msgbox("Yes or no?",4)','vbscript')
if(ret==6)
window.open("http://colorweb.go.163.com")
else
window.open("http://luvky.myrice.com")
</script>
xiaobeibei 2002-05-13
  • 打赏
  • 举报
回复
关注
qiushuiwuhen 2002-05-13
  • 打赏
  • 举报
回复
<script language=vbs>
msgbox "a",4
</script>
Andrawu 2002-05-13
  • 打赏
  • 举报
回复
confirm()是确定和取消啊。
有没有办法将确定和取消改为“否”和“是”呢?
孟子E章 2002-05-13
  • 打赏
  • 举报
回复
<script>
if(confirm("到我这里看看好吗???"))
window.open("http://colorweb.go.163.com")
else
window.open("http://luvky.myrice.com")
</script>
Andrawu 2002-05-13
  • 打赏
  • 举报
回复
<script>
function showDialog(){
var arr = showModalDialog("dialog.html", "", "dialogWidth:15.5em; dialogHeight:5.5em; status:0");
if (arr != null && arr)
window.open("show.html");
else
window.open("other.html");
}
</script>
<BODY BGCOLOR="#FFFFFF">
<input type="button" value="show" onclick="showDialog();">
</BODY>

dialog.html
<script>
function ret(para){
window.returnValue =para ;
window.close();
}
</script>
<BODY BGCOLOR="#FFFFFF">
<table align="center"><tr><td>
<input type="button" name="b1" value="《是》" onclick="ret(true)">
<td>
<input type="button" name="b2" value="《否》" onclick="ret(false)">
</table>
</BODY>

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧