在JavaScript中更改confirm()的默认标题? [英] Changing the default title of confirm() in JavaScript?

查看:4513
本文介绍了在JavaScript中更改confirm()的默认标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以修改在JavaScript中打开confirm()函数的消息框的标题?

Is it possible to modify the title of the message box the confirm() function opens in JavaScript?

我可以创建一个模态弹出框,但我想尽可能简化。
我想这样做:

I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this:

confirm("This is the content of the message box", "Modified title");

Internet Explorer中的默认标题是Windows Internet Explorer,在Firefox中它是[JavaScript-program ]。信息量不大。虽然我可以从浏览器安全角度理解你不应该这样做。

The default title in Internet Explorer is "Windows Internet Explorer" and in Firefox it's "[JavaScript-program]." Not very informative. Though I can understand from a browser security stand point that you shouldn't be able to do this.

推荐答案

这是不可能的正如你所说,从安全角度来看。你可以模拟它的唯一方法是创建一个无模式对话窗口。

This is not possible, as you say, from a security stand point. The only way you could simulate it, is by creating a modeless dialog window.

你可以使用很多第三方javascript插件来伪造这种效果,这样你就可以了不必写所有代码。

There are many third-party javascript-plugins that you could use to fake this effect so you do not have to write all that code.

这篇关于在JavaScript中更改confirm()的默认标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆