<html>
<head>
<script type="text/javascript">
function display_alert() {
alert("I am an alert box!!")
}
</script>
</head>
<body>
<input type="button" onclick="display_alert()" value="Display alert box" />
</body>
</html>
用上述代码试了很多次没用,网上有很多解决方案,发现还是第4条比较好,简单粗暴效果最好:
1、html不支持alert,自构alert。
2、清浏览器缓存
3、允许浏览器弹框
4、更新chrome
本文探讨了在HTML中使用JavaScript实现alert弹窗时遇到的问题,并提供了有效的解决方案,包括自定义alert、清理浏览器缓存、允许弹框及更新Chrome等方法。
1697

被折叠的 条评论
为什么被折叠?



