• <small id='Og8ea'></small><noframes id='Og8ea'>

      1. <legend id='Og8ea'><style id='Og8ea'><dir id='Og8ea'><q id='Og8ea'></q></dir></style></legend>
        • <bdo id='Og8ea'></bdo><ul id='Og8ea'></ul>

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

        将参数发送到引导模式窗口?

        时间:2023-06-13
      3. <tfoot id='X4cSX'></tfoot>

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

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

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

                1. 本文介绍了将参数发送到引导模式窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个问题,我无法将任何参数传递给模式窗口(使用 Bootstrap 3),我尝试使用此链接中所述的解决方案,但无法使其工作:

                  I have a problem, I cannot pass any parameters to a modal window (using Bootstrap 3), I tried using the solution stated in this link, but I cannot make it work:

                  将信息动态加载到 Twitter Bootstrap 模式

                  (解决方案kexxcream用户).

                  (Solution kexxcream user).

                  但是按下按钮,显示屏什么也没有显示,显然是块,附下一张图片:

                  But pressing the button, the display does not show me anything, apparently blocks, attached a picture below:

                  http://i.imgur.com/uzRUyf1.png

                  我已附上代码(左上方相同的代码帖子);

                  I have attached the code (same code post above left);

                  HTML 代码:

                        <div id="myModal" class="modal hide fade">
                        <div class="modal-header">
                          <button class="close" data-dismiss="modal">&times;</button>
                          <h3>Title</h3>
                        </div>
                        <div class="modal-body">            
                            <div id="modalContent" style="display:none;">
                  
                            </div>
                        </div>
                        <div class="modal-footer">
                          <a href="#" class="btn btn-info" data-dismiss="modal" >Close</a>
                        </div>
                    </div> 
                  

                  JS代码:

                      $("a[data-toggle=modal]").click(function() 
                      {   
                          var essay_id = $(this).attr('id');
                  
                          $.ajax({
                              cache: false,
                              type: 'POST',
                              url: 'backend.php',
                              data: 'EID='+essay_id,
                              success: function(data) 
                              {
                                  $('#myModal').show();
                                  $('#modalContent').show().html(data);
                              }
                          });
                      });
                  

                  按钮:

                  <a href='#myModal' data-toggle='modal' id='2'> Edit </a>
                  

                  PHP 代码(backend.php):

                  PHP Code (backend.php):

                  <?php
                  $editId = $_POST['EID'];
                  ?>
                    <div class="jumbotron">
                     <div class="container">
                      <h1>The ID Selected is <?php echo $editId ?></h1>
                     </div>
                    </div>
                  

                  推荐答案

                  首先你应该修复模态 HTML 结构.现在不正确了,你不需要类 .hide:

                  First of all you should fix modal HTML structure. Now it's not correct, you don't need class .hide:

                  <div id="edit-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                      <div class="modal-dialog">
                          <div class="modal-content">
                              <div class="modal-header">
                                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                  <h4 class="modal-title" id="myModalLabel">Modal title</h4>
                              </div>
                              <div class="modal-body edit-content">
                                  ...
                              </div>
                              <div class="modal-footer">
                                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                  <button type="button" class="btn btn-primary">Save changes</button>
                              </div>
                          </div>
                      </div>
                  </div>
                  

                  然后链接应该通过 data-target 属性指向这个模态:

                  Then links should point to this modal via data-target attribute:

                  <a href="#myModal" data-toggle="modal" id="1" data-target="#edit-modal">Edit 1</a>
                  

                  终于Js部分变得很简单了:

                  Finally Js part becomes very simple:

                      $('#edit-modal').on('show.bs.modal', function(e) {
                  
                          var $modal = $(this),
                              esseyId = e.relatedTarget.id;
                  
                          $.ajax({
                              cache: false,
                              type: 'POST',
                              url: 'backend.php',
                              data: 'EID=' + essayId,
                              success: function(data) {
                                  $modal.find('.edit-content').html(data);
                              }
                          });
                      })
                  

                  这篇关于将参数发送到引导模式窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Twitter Bootstrap modal 将 html 内容推送到左侧 下一篇:防止引导模式窗口在提交表单时关闭

                  相关文章

                  • <bdo id='DanpT'></bdo><ul id='DanpT'></ul>
                  <i id='DanpT'><tr id='DanpT'><dt id='DanpT'><q id='DanpT'><span id='DanpT'><b id='DanpT'><form id='DanpT'><ins id='DanpT'></ins><ul id='DanpT'></ul><sub id='DanpT'></sub></form><legend id='DanpT'></legend><bdo id='DanpT'><pre id='DanpT'><center id='DanpT'></center></pre></bdo></b><th id='DanpT'></th></span></q></dt></tr></i><div id='DanpT'><tfoot id='DanpT'></tfoot><dl id='DanpT'><fieldset id='DanpT'></fieldset></dl></div>
                2. <small id='DanpT'></small><noframes id='DanpT'>

                    <tfoot id='DanpT'></tfoot>
                    1. <legend id='DanpT'><style id='DanpT'><dir id='DanpT'><q id='DanpT'></q></dir></style></legend>