how to prevent possible javascript memory hogging from crashing a browser

别说谁变了你拦得住时间么 提交于 2019-12-23 02:17:17

问题


Especially when using while loops scenarios can arise where javascript gets stuck in a continuous loop that can crash the browser.

I usually handle this possibility by using a variable to count the number of while executions and break the while after a certain time.

While the browser no longer crashes it can still slow things down considerably.

Is there a more efficient way of handling this possibility?

来源:https://stackoverflow.com/questions/15676710/how-to-prevent-possible-javascript-memory-hogging-from-crashing-a-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!