通过Ajax将数据发送到API

I have simple form for sending email dato to API, but i want send data via Ajax for not reaload page and give success message under input tag.

HTML Sending form

HTML:

<form action="" method="POST" class="send-modal-data">
    <input type="text" id="send_email" name="subscribe-email" class="modal-input" placeholder="Email *">
    <button name="subscribe-form" class="danger-btn send-subscribe">Send</button>           
</form>

Ajax

  $(function() {
    $(".send-subscribe").click(function(e) {
    e.preventDefault();
    var settings = {
       email:  $("#send_email"),
      "url": "xxxx/api/user/trial/subscribe?email=" + email,
      "method": "POST",
      "timeout": 0,
    };

    $.ajax(settings).done(function (response) {
      console.log(response);
    });

    });
});

But when i send email, my modal window closing and not send data, how i can realize with right way ?

Your post function should look something like this:

$(".send-subscribe").click(function() {
    $.post("https://xxx/api/user/subscribe", {
        email : $("#send_email")
    }, function(data, status){
        console.log(status + " :: " + data);
    });
}); 

You than can use status and data to continue your work.