javascript 警报框在 FireFox4 中不起作用
JavaScript alert
框的右上角没有关闭标记,也没有显示任何警报符号,如下所示。
在 IE8 中同样可以正常工作
两者均在 Windows 7 平台上运行
The JavaScript alert
box is appearing without close mark on top right side nor its showing any alert symbol as shown below.
The same in IE8 works fine
Both are running on Windows 7 platform
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所看到的是 Firefox 4 如何呈现警报框。他们追求极简主义的外观。
您对此无能为力——
alert()
函数如何呈现其弹出窗口完全由浏览器决定,而且它们的做法都略有不同。如果您想控制该框的外观,则需要用 Javascript 编写自己的内容,或者使用由其他人编写的数百个 Javascript 和 JQuery 示例之一,这些人已经发现他们需要比标准警报框提供的更多灵活性他们。
[编辑]
这是一篇博客文章,其中讨论了警报框工作方式的更改: http://www.derekallard.com/blog/post/firefox-4-alert-boxes/
实际上,改变的不仅仅是外观;事实上,FF4 中的工作方式也完全不同。
What you're seeing is how Firefox 4 renders an alert box. They've gone for a minimalist look.
There's nothing you can do about it -- how the
alert()
function renders its popup is entirely at the discression of the browser, and they all do it slightly differently.If you want control over how the box looks, you will need to write your own in Javascript, or use one of the hundreds of Javascript and JQuery examples written by other people who have already found they need more flexibility than the standard alert box can give them.
[EDIT]
Here's a blog post where the change to how the alert box works is discussed: http://www.derekallard.com/blog/post/firefox-4-alert-boxes/
There's actually a lot more that's changed than just how it looks; it actually works quite differently too in FF4.