使用 showModalDialog 或 jQuery 对话框
当开发目标浏览器仅为 IE(IE6 - 我知道很糟糕)的 Intranet 应用程序时,我们是否有任何理由不应该使用 IE 的 showModalDialog()
功能来显示对话框窗口?
我的同事更喜欢使用 showModalDialog()
,但我更喜欢使用 jQuery 插件,例如 FancyBox、FaceBox 或 ThickBox。
When developing an intranet application where the target browser is IE only (IE6 - horrible I know) is there any reason that we shouldn’t use the showModalDialog()
feature of IE to display dialog windows?
My colleague prefers using showModalDialog()
but I prefer using a jQuery plug-in such as FancyBox, FaceBox or ThickBox instead.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会避免使用 showModalDialog 只是因为在未来的某个阶段 IE6 将被贬值,你将不得不返回并修复所有问题。我知道一些大型组织速度很慢,但是您认为他们在 2 到 3 年内还会使用 IE6 吗?
另一方面,如果是咨询工作,就这样做,然后在 3 年后再次向他们收取修复费用。
I would avoid showModalDialog just because at some stage in the future IE6 will be depreciated and you will have to go back and fix it all. I know some large organisations are slow, but do you think they will still be using IE6 in 2 or 3 years?
On the other hand, if it is a consulting gig, do it this way and then in 3 years time charge them again to fix it.
我的观点是,
window.showModalDialog()
不会被弃用,因为它存在于大多数主要浏览器中,并且在除 Chrome 之外的所有浏览器中都能完美运行。My opinion is that
window.showModalDialog()
will not be deprecated as it is present in most major browsers and works perfect in all of them except Chrome.这实际上取决于您在做什么,但是您列出的插件实际上并不相当于对话框窗口。它们更多的是为了漂亮/奇特地展示照片和内容。
我建议使用非专有的东西,因为你的公司不可能永远停留在 IE6 上(尽管有时看起来是这样!)。
我还建议查看 jQuery UI 库并使用他们的 对话框小部件,提供丰富的用户体验。
It really depends on what you are doing, but the plugins you listed are not really the equivalent of a dialog window. They are more for a nice/fancy display of photos and content.
I would recommend with going with something non proprietary because your company can't stay on IE6 forever (Though it seems like it some times!).
I would also recommend looking into the jQuery UI library and using their Dialog widget to provide a rich user experience.