How to submit a form with AJAX/JSON?

后端 未结 4 911
温柔的废话
温柔的废话 2020-12-18 08:24

Currently my AJAX is working like this:

index.php

One    
4条回答
  •  遥遥无期
    2020-12-18 08:43

    Have a look at the $.ajaxSubmit function in the jQuery Form Plugin. Should be as simple as

     $('#myForm').ajaxSubmit();
    

    You may also want to bind to the form submit event so that all submissions go via AJAX, as the example on the linked page shows.

提交回复
热议问题