我写了一个很简单的页面:

<html>
<head>
 <script type="text/javascript">
   function fact(x){return x<=1?1:fact(x-1)*x};
   function disp(x){document.write(fact(x));}
 </script>
</head>
<body onload="disp(5)">
</body>
</html>

这个代码在IE和FF下都运行很正常,计算5的阶乘,但是在Chrome下就崩溃了。应该是Chrome的bug吧?

PS: 后来发现不是,详见下文

http://stackoverflow.com/questions/762416/why-isnt-chrome-running-this-javascript 

相关文章:

  • 2021-09-13
  • 2021-05-14
  • 2022-12-23
  • 2021-11-15
  • 2021-06-12
  • 2021-08-07
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-05-27
  • 2022-01-26
相关资源
相似解决方案