send multiple data in ajax

Posted by w3diy - 5 months ago

How to send multiple data fields via jQuery Ajax?

jQuery Ajax post method Example

<script type="text/javascript">
         $(document).ready(function(){ 
              $( "#get_members" ).on( "click", function(event) {             
                          var uri = 'http://api.pakainfo.com/php/';
                          var membername = $("#fname").val();
                          var member_details = $("#lname").val();
                          $.post(uri+"savemembers.php",{membername,member_details},function(response,status){
                              alert("response Status = "+status+" Response = "+response);
                          });     
              });               
          });
</script>