代码是从网上摘抄的,感觉应该显示的样字和代码描述的不一致,不过实际上这样的效果正是我要的,所以就没修改了,哈哈!
晕,今天才发现在FIREFOX和IE上显示的效果不一样,不好意思,效果没达到,请各位看官收下留情。文章就不删了!
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>
</title>
<script language="javascript" type="text/javascript">
function DoAlert() {
alert(\'管他,能用就行!\');
}
</script>
</head>
<body>
<input id="TestAlert" type="button" onclick="DoAlert()" value="TestAlert" />
</body>
</html>
<script type="text/javascript">
window.alert = function (txt) {
document.write(\'<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">\');
document.write(\' <tr>\');
document.write(\' <td align="center" bgcolor="#CCCCCC">操作提示</td>\');
document.write(\' </tr>\');
document.write(\' <tr>\');
document.write(\' <td bgcolor="#FFFFFF">\' + txt + \'</td>\');
document.write(\' </tr>\');
document.write(\' <tr>\');
document.write(\' <td align="center" bgcolor="#FFFFFF"><input type="button" name="Submit" value="返回" onclick="window.history.go(-1)"/>\');
document.write(\' <input type="button" name="Submit2" value="关闭" onclick="window.close()"/></td>\');
document.write(\' </tr>\');
document.write(\'</table>\');
</script>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>
</title>
<script language="javascript" type="text/javascript">
function DoAlert() {
alert(\'管他,能用就行!\');
}
</script>
</head>
<body>
<input id="TestAlert" type="button" onclick="DoAlert()" value="TestAlert" />
</body>
</html>
<script type="text/javascript">
window.alert = function (txt) {
document.write(\'<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">\');
document.write(\' <tr>\');
document.write(\' <td align="center" bgcolor="#CCCCCC">操作提示</td>\');
document.write(\' </tr>\');
document.write(\' <tr>\');
document.write(\' <td bgcolor="#FFFFFF">\' + txt + \'</td>\');
document.write(\' </tr>\');
document.write(\' <tr>\');
document.write(\' <td align="center" bgcolor="#FFFFFF"><input type="button" name="Submit" value="返回" onclick="window.history.go(-1)"/>\');
document.write(\' <input type="button" name="Submit2" value="关闭" onclick="window.close()"/></td>\');
document.write(\' </tr>\');
document.write(\'</table>\');
</script>