问题描述
我正在使用 JavaScript 的 prompt()
函数.
I'm using JavaScript's prompt()
function.
var favorite = prompt('What is your favorite color?', 'RED');
我使用的是 IE 7,打开的提示框有一个标题栏,上面写着:资源管理器用户提示"和进一步的文字,上面写着脚本提示:"然后下面是我的文字:你最喜欢的颜色是什么?'此外,确定"和取消"按钮出现在提示框的最右侧,文本输入框出现在对话框的最底部.
I'm using IE 7 and the prompt box that opens has a title bar that says : 'Explorer User Prompt' and further text that says 'Script Prompt:' Then beneath this is my text : 'What is your favorite color?' Also the 'OK' and 'Cancel' buttons appear in the far right side of the prompt box and the text entry box appears at the very bottom of the dialogue.
有什么办法可以更改标题栏,删除脚本提示"文本,并将确定"和取消"按钮放在文本输入框下方?
Is there any way to change the title bar, remove the text 'Script Prompt', and put the OK and cancel buttons beneath the text entry box?
推荐答案
不,我不这么认为.问题是人们会恶意使用提示,所以微软补充说,让它看起来更像是一个页面特定的提示而不是 IE 提示.
No I don't believe so. The problem was that people would use prompts maliciously so microsoft added that to make it look more like it was a page specific prompt and not a IE prompt.
您可以使用 jQuery 或其他工具进行页内对话框:
You can do an in page dialog with jQuery or something:
http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs
这篇关于更改使用 JavaScript prompt() 显示的格式和文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!