AJAX reload page with POST

前端 未结 4 1858
眼角桃花
眼角桃花 2020-12-18 20:20

Can anybody tell me how to refresh the current page with JavaScript, having a POST variable modified or added?

To be clear, I want to set some POST variables prior t

4条回答
  •  清歌不尽
    2020-12-18 20:30

    There's another way with post instead of ajax

    var jqxhr = $.post( "example.php", function() {
      alert( "success" );
    })
      .done(function() {
        alert( "second success" );
      })
      .fail(function() {
        alert( "error" );
      })
      .always(function() {
        alert( "finished" );
      });
    

提交回复
热议问题