简体   繁体   English

网站在代码中的计算过程中变得无响应。 但是计算完成后开始工作? [JavaScript]

[英]Website becomes unresponsive during calculations which are there in code. But starts working when calculation is done? [JavaScript]

My code contains the calculations which cannot be broken down into number of small calculations (Permutation generation code)我的代码包含不能分解为小计算数量的计算(排列生成代码)

Its taking some time and hence page shows that the website has gone unresponsive.它需要一些时间,因此页面显示该网站已无响应。

But when the calculation is completed, that alert closes and it shows the correct result.但是当计算完成时,该警报会关闭并显示正确的结果。

Now, How can I get rid of that alert?现在,我怎样才能摆脱那个警报? (it is in javascript) (它在javascript中)

Please help!!!请帮忙!!!

You can use Web Worker, A web worker is a JavaScript running in the background, without affecting the performance of the page.您可以使用 Web Worker,Web Worker 是在后台运行的 JavaScript,不会影响页面的性能。

https://www.w3schools.com/html/html5_webworkers.asp https://www.w3schools.com/html/html5_webworkers.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM