错误处理“内存不足异常"在浏览器中?

编程入门 行业动态 更新时间:2024-10-28 00:18:27
本文介绍了错误处理“内存不足异常"在浏览器中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在调试一个使用大量内存的 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-22 04:41:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1015695.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:器中   异常   错误   内存不足   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!