简体   繁体   English

等待响应时暂停javascript执行

[英]Pause javascript execution while waiting on response

I'm looking for a way to pause a javascript function while waiting for the user to make a choice. 我正在寻找一种在等待用户做出选择时暂停javascript函数的方法。 I would like it to work like prompt, alert or confirm (they pause the script) but I would like to create my own query box in html. 我希望它可以像提示,警报或确认(它们暂停脚本)一样工作,但是我想在html中创建自己的查询框。

Is there any way that I can achieve this? 有什么办法可以做到这一点?

设置一个回调,当用户做出选择时将调用该回调,然后在向用户显示选择后让javascript结束。

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

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