【问题标题】:How to pass jquery ajax response to bootstrap modal如何将 jquery ajax 响应传递给引导模式
【发布时间】:2019-06-15 16:37:25
【问题描述】:

我目前有这个在警报框中显示响应,但希望它显示在引导模式中,但还没有让它工作。这是我的jQuery代码。 我试过了


<script type="text/javascript">


  $("#set").click(function(){
    $('.spinner-grow').show();
    var id =  $('.auth').val();

  $.post("https://ravesandboxapi.flutterwave.com/v2/gpx/transactions/escrow/settle",
  {
    id: id,
    secret_key: "FLWS****************20628-X"
  },

  function(status){
    $('.modal-body').html(status);
   $('#verifyModal').modal('show');
    $('.spinner-grow').hide();
  });
});


</script>

我有这个作为模态

<div class="modal fade" id="verifyModal" tabindex="-1" role="dialog" aria-labelledby="verifyModalLabel" aria-hidden="false">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">

      <div class="modal-header">
        <h6>Payment Veification</h6>
      </div>



      <div class="modal-body" align="center">

      </div>


      <div class="modal-footer">

         <button style="outline: none;" type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"><small style="color: navy; font-size: 15px;"><b>Close</b></small></span>
        </button>


      </div>
    </div>
  </div>
</div>

我究竟怎样才能完成这项工作?

【问题讨论】:

标签: jquery ajax laravel bootstrap-4


【解决方案1】:

你可以尝试这样的事情

$.ajax({
  type: "POST",
  dataType: "json",
  url: "url",
  data:data
  success: function(status) {
    $('.modal-body').html(status);
    $('#verifyModal').modal('show');
    $('.spinner-grow').hide();
  };
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-01
    • 2015-10-24
    • 2018-01-25
    • 1970-01-01
    • 2015-01-27
    相关资源
    最近更新 更多