XMLHttpRequest has been launched for a long time, and W3C has introduced some good features. Ruan Yifeng has a good article on this, which summarizes the XMLHttpRequest Level 2 user guide. Excluding outdated browsers in actual use, the simplest way to use is to generate the submit event of the FORM hander FORM using the standard HTML syntax, generate XMLHttpRequest with FormData to submit data, return false to submit to process XMLHttpRequest results, and form submission in ajax mode is completed. Of course, this supports file upload. If we use jQuery. the ajax code is like this. Js code: $ ('yourform '). submit (function () {var formdata = new FormData (this); $. ajax ({type: 'post', url: '/yourpath', data: formdata,/*** must be false to automatically add the correct Content-Type */contentType: false,/*** must be false to avoid jQuery's default processing of formdata * XMLHttpRequest will correctly process formdata */processData: false }). then (function () {// doneCal}, function () {// failCal}); return false ;}); that's simple under standard. In many cases, users are required to use modern browsers. For example, for editing, it corresponds to a customized enterprise user.