综合参考:
http://jingyan.baidu.com/article/47a29f242b180ac0142399f9.html
http://blog.csdn.net/hshl1214/article/details/46744387
<html>
<!--http://jingyan.baidu.com/article/47a29f242b180ac0142399f9.html-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function duihua()
{
alert("这个窗口是对话框!")
}
function queren(id)
{
var res=confirm("请选择点击一个按钮!");
if (res==true)
{
//alert("你按下的是【确认】");
//跳转到指定页面并传递id参数
window.location.href="http://test.com/userlist?param="+id;
}
else
{
alert("你按下的是【取消】");
}
}
function tishi()
{
var t=prompt("请输入您的名字","KING视界")
if (t!=null && t!="")
{
document.write("精彩MV就在," + t + "!属于你的世界")
}
}
</script>
</head>
<body>
<input type="button" οnclick="duihua()" value="点击显示对话框" />
<input type="button" οnclick="queren()" value="点击显示确认框" />
<input type="button" οnclick="tishi()" value="点击显示提示框" />
</body>
</html>示例:
转载于:https://blog.51cto.com/xoyabc/1959496
