简体   繁体   English

在JavaScript中模拟“警告”或“提示”

[英]Emulate a “alert” or “prompt” in JavaScript

I'm aware of the principles behind event driven programming but would nevertheless try to better understand if and how it is possible to emulate the functionality of the native alert or prompt functions in JavaScript. 我知道事件驱动编程背后的原理,但是尽管如此,我还是会尝试更好地了解是否以及如何能够模拟JavaScript中的本机警报或提示功能。 Clearly the point is the blocking behavior of those native functions and how this could be emulated in JavaScript. 显然,关键是这些本机函数的阻塞行为以及如何在JavaScript中对其进行仿真。

you could use twitters bootstrap - modal: twitter.github.com/bootstrap/javascript.html#modals 您可以使用twitters引导程序-模态:twitter.github.com/bootstrap/javascript.html#modals

or jquerys ui - modal: jqueryui.com/demos/dialog/#modal-confirmation 或jquery ui-模式:jqueryui.com/demos/dialog/#modal-confirmation

both are non blocking 两者都不阻塞

//edit: this? //编辑:这个? https://github.com/malsup/blockui/blob/master/jquery.blockUI.js && http://jquery.malsup.com/block/#demos https://github.com/malsup/blockui/blob/master/jquery.blockUI.js && http://jquery.malsup.com/block/#demos

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

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