Modaldialog仅在IE中打开而不在其他浏览器中打开 [英] Modaldialog opens only in IE not in other browser

查看:83
本文介绍了Modaldialog仅在IE中打开而不在其他浏览器中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在javascript中,ModalDialog.show()在IE中打开,但在其他浏览器中不会打开。



我尝试了什么:



在javascript中,ModalDialog.show()在IE中打开但在其他浏览器中不会打开。

解决方案

< blockquote>无论你使用什么都会出现问题。

HTML DOM Dialog showModal( )方法 [ ^ ],其工作原理一些浏览器,所以你可能能够找出一些工作方式来使用这两种方法。

但是说实话,网页中的模态对话只是说服我永远不再访问该网站...


使用这个API不是一个好主意,甚至不是因为它的浏览器兼容性差,而是因为这是从Web标准中删除的功能: Window.showModalDialog() - Web API



在我的文章中,我解释了你可能有的更合理的替代方案以及背后的一些理由:从零开始的模态弹出窗口



我解释了如何从头开始做事,但最常用的方法是使用jQuery UI和jQuery插件,jQuery UI的第三方(统称为modal popup) Dialog

Dialog | jQuery UI

模态弹出窗口



-SA


In javascript, ModalDialog.show() opens in IE but does not opens in other browser.

What I have tried:

In javascript, ModalDialog.show() opens in IE but does not opens in other browser.

解决方案

It's going to be a problem whatever you use.
There is the HTML DOM Dialog showModal() Method[^], which works on some browsers, so you may be able to work out somethign that works usign the two methods.
But to be honest modal dialogs in web pages just persuade me never to visit the site again...


Using this API is not a good idea, not even because it has poor browser compatibility, but because this is the feature removed from Web standards: Window.showModalDialog() — Web APIs.

In my article, I explained more reasonable alternatives you may have and some rationale behind: Modal Popup From Scratch.

I explained how to do things from scratch, but the most usual approach is using jQuery UI with jQuery plug-ins, 3rd-party ones (collectively known under the name "modal popup") of jQuery UI Dialog:
Dialog | jQuery UI,
Modal Popup.

—SA


这篇关于Modaldialog仅在IE中打开而不在其他浏览器中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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