Home
Web Front-end
JS Tutorial
Asynchronous form submission under jquery Asynchronous cross-domain form submission_jquery



Asynchronous form submission under jquery Asynchronous cross-domain form submission_jquery
Cross domain
1. Use the post submission method
2. Construct the form format
3. Call the ajax callback function in conjunction with the submit of the form form.
Use jQuery to submit the form code asynchronously:
Copy the code The code is as follows:
< html xmlns="http://www.w3.org/1999/xhtml">
<script> <br>jQuery(function($) { <br>// Use jQuery Asynchronous form submission<br>$('#f1').submit(function() { <br>$.ajax({ <br>url: 'ta.aspx', <br>data: $('#f1' ).serialize(), <br>type: "post", <br>cache : false, <br>success: function(data) <br>{alert(data);} <br>}); <br> return false; <br>}); <br>}); <br></script>