开发者

Change Title of Javascript Alert [duplicate]

This question already has answers here: 开发者_如何学运维 How to edit a JavaScript alert box title? (10 answers) Closed 7 years ago.

How can i change the title of javascript alert popup ?


You can't, this is determined by the browser, for the user's safety and security. For example you can't make it say "Virus detected" with a message of "Would you like to quarantine it now?"...at least not as an alert().

There are plenty of JavaScript Modal Dialogs out there though, that are far more customizable than alert().


As others have said, you can't do that either using alert()or confirm().

You can, however, create an external HTML document containing your error message and an OK button, set its <title> element to whatever you want, then display it in a modal dialog box using showModalDialog().


Simple: you can't.


You can't. The alert is a simple popup where you only can affect the content text.

If you want to change anything else, you have to use a different way of creating a popup.


you cant do this. Use a custom popup. Something like with the help of jQuery UI or jQuery BOXY.

for jQuery UI http://jqueryui.com/demos/dialog/

for jQuery BOXY http://onehackoranother.com/projects/jquery/boxy/


It's not possible, sorry. If really needed, you could use a jQuery plugin to have a custom alert.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜