No, you would need to build out a dialog box in order to achieve this.
You are able to achieve this with relative ease through jQuery and more specifically the jQuery UI plugin, allowing dialog boxes to come up without too much know-how
confirm (display string and get yes/no|true/false back);
prompt (display string and get input string back)
You can create your own modal dialog using a variety of techniques. Under the hood, they all essentially do the same thing - display a separate web page in a popup window or iFrame and disable input access to the rest of the browser until the popup is closed. These are pretty easy to get wrong (hard to use + very annoying) but when done right they offer the developer a lot of power - since it's a complete web page you control, you can pass complex JavaScript objects between the dialog and the main browser window, instead of having to rely on the primitive interaction modes offered by the out-of-the-box dialogs.
Pretty shure it isn't possible. However, you can simulate a "alert box" with the contents you need. JQuery, for example, is a great javascript framework to achieve that.
发布评论
评论(5)
不,您需要构建一个对话框才能实现此目的。
您可以通过 jQuery 相对轻松地实现此目的,更具体地说是 jQuery UI 插件,允许出现对话框无需太多专业知识即可完成
No, you would need to build out a dialog box in order to achieve this.
You are able to achieve this with relative ease through jQuery and more specifically the jQuery UI plugin, allowing dialog boxes to come up without too much know-how
否。唯一的选项是:
您可以使用各种技术。在幕后,它们本质上都做同样的事情 - 在弹出窗口或 iFrame 中显示单独的网页,并禁用对浏览器其余部分的输入访问,直到弹出窗口关闭。这些很容易出错(很难使用+非常烦人),但是如果做得正确,它们将为开发人员提供很多功能 - 因为它是您控制的完整网页,所以您可以在对话框和主浏览器之间传递复杂的 JavaScript 对象窗口,而不必依赖开箱即用的对话框提供的原始交互模式。
No. The only options are:
You can create your own modal dialog using a variety of techniques. Under the hood, they all essentially do the same thing - display a separate web page in a popup window or iFrame and disable input access to the rest of the browser until the popup is closed. These are pretty easy to get wrong (hard to use + very annoying) but when done right they offer the developer a lot of power - since it's a complete web page you control, you can pass complex JavaScript objects between the dialog and the main browser window, instead of having to rely on the primitive interaction modes offered by the out-of-the-box dialogs.
很确定这是不可能的。但是,您可以用您需要的内容模拟“警报框”。例如,JQuery 就是一个很好的 JavaScript 框架来实现这一点。
Pretty shure it isn't possible. However, you can simulate a "alert box" with the contents you need. JQuery, for example, is a great javascript framework to achieve that.
不,但您可以创建一个函数来打开一个包含 html 的警报框,就像在 facebook 上一样。
no, but you can create a function that opens a alert box with html in it, like on facebook.
不,但您可以创建带有警报框的函数。
是唯一可用的。
No, but you can create functions with alert boxes.
are the inly available ones.