How to redirect through 'POST' method using Javascript?

前端 未结 11 1125
说谎
说谎 2020-12-05 10:05

I\'ve queried and doesn\'t work out what I\'ve found. Is there any way to redirect to give url with POST method using Javascript or jquery?

11条回答
  •  误落风尘
    2020-12-05 10:32

    huh... use AJAX Jquery:

    > $.ajax({
    >                       type: "POST",
    >                       url: "www.example.com/the_page_I_post_to.php",
    >                       data: $('yourform').serialize(),//sent data
    >                       success: function(msg) {
    >                           alert("posted !");
    >                        }
    

提交回复
热议问题