js ie下有效 showModalDialog 、showModelessDialog

 

 1         <input type="button" value="打开选择输入框"/>
 2         <script type="text/javascript">
 3 
 4       //IE有效 chrome无效       模式 与非模式 
 5          //window.showModalDialog("asdfasdf");
 6          //window.showModelessDialog("asdfasdf");
 7             //定位按钮,同时添加事件
 8             document.getElementsByTagName("input")[0].onclick=function(){
 9                 //以模式和非模式方式打开窗口
10                 var url = "childNodes.html";
11                 var sFeatures = "dialogHeight:400px;dialogWidth:200px;dialogLeft:20%";
12                 
13                 
14                 
15                 window.showModalDialog(url,null,sFeatures);//模式(用途较多)
16                 //window.showModelessDialog(url);//非模式
17             }
18         </script>

 

posted on 2014-05-08 20:33  wf110  阅读(386)  评论(0编辑  收藏  举报