网页alert对话框

来源:百度知道 编辑:UC知道 时间:2024/05/23 16:00:25
<script language=JavaScript>
<!--
var message="Fuck you!\nDon't copy!\nDo you know?\n by TorzSaber";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>

我的代码..效果大家自己试下吧..我就不说了..
我想要弹出的对话框的确定"按钮"变成"Yes"
标题变为"Warning"

请萜出完整代码,,最后拿分200+50...
回答者: smluyi 你说的不错。。
但是那个

不用alert(),用window.showmodelDialog().这样你别说改字了,你就加图片都没有问题,我的思路是,弹出一个子完全窗体,你设置一 下子窗体的属性,改成弹出对话框大不差不多的,你再随便那么一改,OK了
代码:
在你要弹出的页面写如下方法
<script language="javascript">
function show()
{
var sta="dialogWidth:310px;dialogHeight:110px;status:no;help:no";
window.showModalDialog("2.html",window,sta);
}
</script>
<body onload="show();">
</body>

2.html文件代码
<head>
<title>
Wrong
</title>
</head>
<body>
<table align=center valign="bottom">
<tr>
<td>
这是你要的吗?你还可以加图片啊!
</td>
</tr>
<tr align=center>
<td><input type="button" name="sb" value="Yes"/></td>
</tr>
</table>
</body>
你试试吧,还不赖!

长。