今天写小测试页面时,第一次遇到了“Uncaught RangeError: Maximum call stack size
exceeded ”这个错误,这个错误一般是代码书写不正确引起的,最终经过检查发现了js的函数名使用关键字,修改即好。当然这只是出现“Uncaught
RangeError: Maximum call stack size exceeded”错误的其中一种情况。

报错代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta
http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Maximum
call stack size exceeded test</title> <script type="text/javascript">
//点击按钮方法(错误写法) function onclick() { //test alert(1); } </script> </head> <body>
<input value="点击按钮测试" type="button" onclick="onclick()" /> </body> </html>
运行报错:



修改函数名(把onclick 修改为onclick1 ):
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta
http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Maximum
call stack size exceeded test</title> <script type="text/javascript">
//点击按钮方法(修复之后) function onclick1() { //test alert(1); } </script> </head>
<body> <input value="点击按钮测试" type="button" onclick="onclick1()" /> </body>
</html>
再次运行正常。

 

友情链接
ioDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信