JavaScript重写alert方法
程序员文章站
2023-12-22 23:18:28
...
text.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="enfowd.js"></script>
<script language="javascript">
sl_alert("你妈喊你回家吃饭!");
</script>
</head>
<body>
<div></div>
</body>
</html>
enfowd.js
function sl_alert(errinfo, url)
{
alert("系统提示:\n\n" + errinfo + "\n\n");
if (url != null)
location.replace(url);
}