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

    <small id='1yIl8'></small><noframes id='1yIl8'>

      • <bdo id='1yIl8'></bdo><ul id='1yIl8'></ul>

      1. jquery可以做到这一点吗?值的弹出窗口

        jquery can do this? popup window for value(jquery可以做到这一点吗?值的弹出窗口)
                <i id='NcsPx'><tr id='NcsPx'><dt id='NcsPx'><q id='NcsPx'><span id='NcsPx'><b id='NcsPx'><form id='NcsPx'><ins id='NcsPx'></ins><ul id='NcsPx'></ul><sub id='NcsPx'></sub></form><legend id='NcsPx'></legend><bdo id='NcsPx'><pre id='NcsPx'><center id='NcsPx'></center></pre></bdo></b><th id='NcsPx'></th></span></q></dt></tr></i><div id='NcsPx'><tfoot id='NcsPx'></tfoot><dl id='NcsPx'><fieldset id='NcsPx'></fieldset></dl></div>
              • <legend id='NcsPx'><style id='NcsPx'><dir id='NcsPx'><q id='NcsPx'></q></dir></style></legend>

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

                  <tbody id='NcsPx'></tbody>
              • <tfoot id='NcsPx'></tfoot>
                • <bdo id='NcsPx'></bdo><ul id='NcsPx'></ul>
                  本文介绍了jquery可以做到这一点吗?值的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当用户单击父窗口中的按钮时,我使用 JavaScript 打开一个新窗口(子窗口).

                  I used JavaScript to open a new window(child) when user clicks on button from parent window.

                  在新窗口(子窗口)上,我有文本框和按钮,当用户单击按钮时,我需要获取文本框的值并传递给父窗口,在关闭子窗口时,我需要将更新的值插入父窗口窗口(不刷新父窗口),所以我可以将我的值显示到父窗口的一些隐藏字段/标签,我该怎么做?

                  On new window(child), I have textbox and button, I need to get the value of the textbox and pass to parent window when user clicks on button, while closing the child window, I need the updated value inserted into parent window (without refreshing parent window) so I can display my value to some hidden field/ label of the parent window , how can I do that?

                  1- 父窗口有按钮,点击的子窗口打开2- 子窗口有文本框和按钮,当点击按钮时,子窗口会向服务器发送更新数据库,然后将文本框的值传递给父窗口而不刷新父窗口,并关闭子窗口.

                  1- parent window has button, clicked child window opened 2- child window has textbox and button, when button clicked, child will do a post to server to update database, then pass the value of textbox to parent window without refreshing parent window, and close child window.

                  我该怎么做?可以用简单的 JavaScript 完成吗?如果我使用 jquery 来做,我会有更多的好处吗?谁能建议我该怎么做?

                  How can I do that? Is it can be done with simple JavaScript? If I do it using jquery, will I have more benefit? Could anyone advice how can I do it?

                  推荐答案

                  我建议使用 jQuery 对话框小部件 而不是一个实际的新窗口.这将使访问新值变得更容易,因为它位于同一窗口的 DOM 中.只需让关闭窗口的按钮的回调从对话框中包含的 DOM 元素中提取值并将其复制到表单上的目标 DOM 元素.

                  I would suggest using the jQuery dialog widget instead of an actual, new window. This will make it easier to access the new value as it's in the same window's DOM. Just have the callback from the button that closes the window extract the value from the DOM element contained in the dialog and copy it to the target DOM element on the form.

                  $('#popupDialog').dialog({
                       modal: true,
                       autoOpen: false,
                       buttons: {
                            'Cancel': function() {
                                         $(this).dialog('close');
                                      },
                            'Accept': function() {
                                         $('#mainForm input#target').val( $(this).find('#widgetName').val() );
                                         $(this).dialog('close');
                                      }
                  });
                  
                  $('#popupButton').click( function() {
                     $('#popuDialog').dialog('open');
                  });
                  
                  
                  <div id="popupDialog" title="Input a new widget name">
                    <p>
                       <label for="widgetName">Please input a new widget name:</label>
                       <input type="text" id="widgetName" />
                    </p>
                  </div>
                  

                  这篇关于jquery可以做到这一点吗?值的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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)(发送自定义用户代理字符串以及我的标头(获取))
                  <legend id='6jBSc'><style id='6jBSc'><dir id='6jBSc'><q id='6jBSc'></q></dir></style></legend>
                • <tfoot id='6jBSc'></tfoot>
                    <bdo id='6jBSc'></bdo><ul id='6jBSc'></ul>
                    <i id='6jBSc'><tr id='6jBSc'><dt id='6jBSc'><q id='6jBSc'><span id='6jBSc'><b id='6jBSc'><form id='6jBSc'><ins id='6jBSc'></ins><ul id='6jBSc'></ul><sub id='6jBSc'></sub></form><legend id='6jBSc'></legend><bdo id='6jBSc'><pre id='6jBSc'><center id='6jBSc'></center></pre></bdo></b><th id='6jBSc'></th></span></q></dt></tr></i><div id='6jBSc'><tfoot id='6jBSc'></tfoot><dl id='6jBSc'><fieldset id='6jBSc'></fieldset></dl></div>

                      <tbody id='6jBSc'></tbody>

                        <small id='6jBSc'></small><noframes id='6jBSc'>