How to submit a form with AJAX/JSON?

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

Currently my AJAX is working like this:

index.php

One    
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-18 08:49

    You can submit the form with jQuery's $.ajax method like this:

    $.ajax({
     url: 'one.php',
     type: 'POST',
     data: $('#myForm').serialize(),
     success:function(data){
       alert(data);
     }
    });
    

提交回复
热议问题