Javascript有许多内建的方法来产生对话框,如:window.alert(), window.confirm(),window.prompt().等。 然而IE提供更多的方法支持对话框。如: showModalDialog() (IE 4+ 支持) window.showModalDialog()方法用来创建一个显示HTML内容的模态对话框,由于是对话框,因此它并没有一般用window.open()打开的窗口的所有属性。 window.showModelessDialog()方法用来创建一个显示HTML内容的非模态对话框。 当我们用showModelessDialog()打开窗口时,不必用window.close()去关闭它,当以非模态方式[IE5]打开时, 打开对话框的窗口仍可以进行其他的操作,即对话框不总是最上面的焦点,当打开它的窗口URL改变时,它自动关闭。而模态[IE4]方式的对话框始终有焦点(焦点不可移走,直到它关闭)。模态对话框和打开它的窗口相联系,因此我们打开另外的窗口时,他们的链接关系依然保存,并且隐藏在活动窗口的下面。 使用方法如下: 参数说明: 还有几个属性是用在HTA中的,在一般的网页中一般不使用。 传入参数: test1.htm 可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如: test4.htm 常见问题: test6.htm 2,可以通过http://servername/virtualdirname/test.htm?name=mxh方式直接向对话框传递参数吗? |
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-9554993499434573&dt=1162868764609&lmt=1162868764&format=160x600_as&output=html&url=http%3A%2F%2Fwww.mf100.com%2Fdocument%2F2005-1%2F377.shtml&color_bg=ECF8FF&color_text=6F6F6F&color_link=0000CC&color_url=008000&color_border=B4D0DC&ad_type=text_image&ref=http%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3DshowModelessDialog%26hl%3Dzh-CN%26lr%3Dlang_zh-CN%257Clang_zh-TW%26nxpt%3D20.300479183308532568727&cc=259&u_h=1024&u_w=1280&u_ah=990&u_aw=1280&u_cd=16&u_tz=480&u_java=true" frameborder="0" width="160" scrolling="no" height="600" allowtransparency="allowtransparency"> |
showModelessDialog()使用详解
最新推荐文章于 2016-10-05 16:46:10 发布