Jquery – SerializeArray()

jQuery SerializeArray() sample code how to send request to your server.

 $.ajax({
    type: "POST",
    url: $(this).attr('action'),
    dataType: "json",
     data     : $(this).serializeArray(),
     success: function(data) {
        if (data.status) { 
		// Success this should redirect or refresh the page. 
		//document.location.reload(true); 
        } else {
		// Error Message 
        }
    },
    error: function(){
              // Error Message 
    }
});

Leave a Reply

Your email address will not be published. Required fields are marked *