1. <i id='Dt5uW'><tr id='Dt5uW'><dt id='Dt5uW'><q id='Dt5uW'><span id='Dt5uW'><b id='Dt5uW'><form id='Dt5uW'><ins id='Dt5uW'></ins><ul id='Dt5uW'></ul><sub id='Dt5uW'></sub></form><legend id='Dt5uW'></legend><bdo id='Dt5uW'><pre id='Dt5uW'><center id='Dt5uW'></center></pre></bdo></b><th id='Dt5uW'></th></span></q></dt></tr></i><div id='Dt5uW'><tfoot id='Dt5uW'></tfoot><dl id='Dt5uW'><fieldset id='Dt5uW'></fieldset></dl></div>
      <tfoot id='Dt5uW'></tfoot>

        <small id='Dt5uW'></small><noframes id='Dt5uW'>

        <legend id='Dt5uW'><style id='Dt5uW'><dir id='Dt5uW'><q id='Dt5uW'></q></dir></style></legend>

        • <bdo id='Dt5uW'></bdo><ul id='Dt5uW'></ul>

        如何使用`window.open`显示模式弹出窗口?

        How to show a modal pop-up using `window.open`?(如何使用`window.open`显示模式弹出窗口?)

        <small id='GshYF'></small><noframes id='GshYF'>

          1. <i id='GshYF'><tr id='GshYF'><dt id='GshYF'><q id='GshYF'><span id='GshYF'><b id='GshYF'><form id='GshYF'><ins id='GshYF'></ins><ul id='GshYF'></ul><sub id='GshYF'></sub></form><legend id='GshYF'></legend><bdo id='GshYF'><pre id='GshYF'><center id='GshYF'></center></pre></bdo></b><th id='GshYF'></th></span></q></dt></tr></i><div id='GshYF'><tfoot id='GshYF'></tfoot><dl id='GshYF'><fieldset id='GshYF'></fieldset></dl></div>
              <bdo id='GshYF'></bdo><ul id='GshYF'></ul>

                <tbody id='GshYF'></tbody>

                  <tfoot id='GshYF'></tfoot>

                1. <legend id='GshYF'><style id='GshYF'><dir id='GshYF'><q id='GshYF'></q></dir></style></legend>
                  本文介绍了如何使用`window.open`显示模式弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前正在使用 window.showModalDilog 打开一个不允许父窗口执行任何操作的模式弹出窗口.

                  I am currently using window.showModalDilog to open a modal pop up window which is not allowing the parent window to do any action.

                  但是通过谷歌搜索发现不是标准方法,各种浏览器已经停止支持这个功能.

                  But through Google search, I found that it is not the standard method and various browsers has stopped supporting this function.

                  事实上,我在 Opera 中遇到了这个问题.Opera 给了我一个 Javascript 错误并在那时停止执行.在该错误之后什么都不会发生.

                  In fact I am facing this problem in Opera. Opera gives me a Javascript error and stops execution at that point. Nothing can happen after that error.

                  所以,我只剩下一个选项,那就是 window.open.

                  So, I have only one option left and that is window.open.

                  但我想禁用父窗口(同样在 showModalDilog 中).

                  But I want to disable parent window (likewise in showModalDilog).

                  我尝试了以下代码:

                  $(window).load(function() {
                      window.opener.document.body.disabled=true;
                  });
                      
                  $(window).unload(function() {
                      window.opener.document.body.disabled=false;
                  });
                  

                  但这没有用.

                  我想在弹窗中打开一个网址,然后在打开网址后做一些动作,包括提交表单.

                  I want to open an URL in the pop-up window and then do certain actions after the URL is opened, including submitting a form.

                  我打开弹窗的代码:

                  window.open("https://www.picpixa.com/wp-content/plugins/create-own-object/plugin-google-drive/index.php", "socialPopupWindow", "location=no,width=600,height=600,scrollbars=yes,top=100,left=700,resizable = no");
                  

                  如果我可以在单击多个按钮时仅打开一个弹出窗口,那也会有所帮助.我的意思是如果我点击btn1"一个名为temp"的弹出窗口;将打开.但是如果我点击btn2"然后不是打开一个新的弹出窗口temp";应该重新加载.

                  It would also help if I could open only one pop-up window on the clicking of multiple buttons. I mean if I click on "btn1" a pop-up named "temp" shall open. But if I click on "btn2" then instead of opening a new pop up "temp" shall reload.

                  推荐答案

                  Modal Window 使用 ExtJS 方法.

                  Modal Window using ExtJS approach.

                  在主窗口中

                  <html>
                  <link rel="stylesheet" href="ext.css" type="text/css">
                  <head>    
                  <script type="text/javascript" src="ext-all.js"></script>
                  
                  function openModalDialog() {
                      Ext.onReady(function() {
                          Ext.create('Ext.window.Window', {
                          title: 'Hello',
                          height: Ext.getBody().getViewSize().height*0.8,
                          width: Ext.getBody().getViewSize().width*0.8,
                          minWidth:'730',
                          minHeight:'450',
                          layout: 'fit',
                          itemId : 'popUpWin',        
                          modal:true,
                          shadow:false,
                          resizable:true,
                          constrainHeader:true,
                          items: [{
                              xtype: 'box',
                              autoEl: {
                                       tag: 'iframe',
                                       src: '2.html',
                                       frameBorder:'0'
                              }
                          }]
                          }).show();
                    });
                  }
                  function closeExtWin(isSubmit) {
                       Ext.ComponentQuery.query('#popUpWin')[0].close();
                       if (isSubmit) {
                            document.forms[0].userAction.value = "refresh";
                            document.forms[0].submit();
                      }
                  }
                  </head>
                  <body>
                     <form action="abc.jsp">
                     <a href="javascript:openModalDialog()"> Click to open dialog </a>
                     </form>
                  </body>
                  </html>
                  

                  在popupWindow 2.html中

                  In popupWindow 2.html

                  <html>
                  <head>
                  <script type="textjavascript">
                  function doSubmit(action) {
                       if (action == 'save') {
                           window.parent.closeExtWin(true);
                       } else {
                           window.parent.closeExtWin(false);
                       }   
                  }
                  </script>
                  </head>
                  <body>
                      <a href="javascript:doSubmit('save');" title="Save">Save</a>
                      <a href="javascript:doSubmit('cancel');" title="Cancel">Cancel</a>
                  </body>
                  </html>
                  

                  这篇关于如何使用`window.open`显示模式弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))
                  <i id='vaAHc'><tr id='vaAHc'><dt id='vaAHc'><q id='vaAHc'><span id='vaAHc'><b id='vaAHc'><form id='vaAHc'><ins id='vaAHc'></ins><ul id='vaAHc'></ul><sub id='vaAHc'></sub></form><legend id='vaAHc'></legend><bdo id='vaAHc'><pre id='vaAHc'><center id='vaAHc'></center></pre></bdo></b><th id='vaAHc'></th></span></q></dt></tr></i><div id='vaAHc'><tfoot id='vaAHc'></tfoot><dl id='vaAHc'><fieldset id='vaAHc'></fieldset></dl></div>

                  <small id='vaAHc'></small><noframes id='vaAHc'>

                  <tfoot id='vaAHc'></tfoot>

                        • <legend id='vaAHc'><style id='vaAHc'><dir id='vaAHc'><q id='vaAHc'></q></dir></style></legend>
                          • <bdo id='vaAHc'></bdo><ul id='vaAHc'></ul>
                              <tbody id='vaAHc'></tbody>