0

I currently have this that displays response in an alert box but want it displayed in a bootstrap modal but have not got it to work yet. This is my jquery code. I have tried


<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>

I have this as the modal

<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>

How exactly can i make this work?

1

1 Answer 1

2

you could have tried something like this

$.ajax({
  type: "POST",
  dataType: "json",
  url: "url",
  data:data
  success: function(status) {
    $('.modal-body').html(status);
    $('#verifyModal').modal('show');
    $('.spinner-grow').hide();
  };
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.