错误处理“内存不足异常"在浏览器中? [英] Error handling "Out of Memory Exception" in browser?

查看:26
本文介绍了错误处理“内存不足异常"在浏览器中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试一个使用大量内存的 javascript/html5 网络应用程序.有时我会在控制台窗口中收到一条错误消息,内容为

I am debugging a javascript/html5 web app that uses a lot of memory. Occasionally I get an error message in the console window saying

"uncaught exception: out of memory".  

有没有办法让我在应用内优雅地处理这个错误?

Is there a way for me to gracefully handle this error inside the app?

最终我需要重写其中的一部分,以防止这种情况发生.

Ultimately I need to re-write parts of this to prevent this from happening in the first place.

推荐答案

我最近在处理一个包含大量 JS 并发送 Json 的项目时也收到相同的错误消息,但我找到的解决方案是更新 input type=提交"属性输入类型=按钮".我知道使用 input type="button"..> 有一些限制,而且解决方案看起来很奇怪,但是如果您的应用程序有带有 JS,Json 数据的 ajax,您可以尝试一下.谢谢.

I also got the same error message recently when working on a project having lots of JS and sending Json, but the solution which I found was to update input type="submit" attribute to input type="button". I know there are limitations of using input type="button"..> and the solution looks weird, but if your application has ajax with JS,Json data, you can give it a try. Thanks.

这篇关于错误处理“内存不足异常"在浏览器中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆