Preventing form resubmission

前端 未结 12 1089

Page one contains an HTML form. Page two - the code that handles the submitted data.

The form in page one gets submitted. The browser gets redirected to page two. P

12条回答
  •  旧巷少年郎
    2020-11-22 09:52

    use js to prevent add data:

    if ( window.history.replaceState ) {
        window.history.replaceState( null, null, window.location.href );
    }
    

提交回复
热议问题