Friday, January 18, 2013

jQuery post call using ajax

jQuery.ajax({
    type: "POST",
    url: "http://domain.com/save_form_data",
    data: jQuery("form").serializeArray(),
    success: function(data) {
        console.log(data);
        alert("Success");
    },
    error: function() {
       alert("Error occurred."); 
    }
});

No comments:

Post a Comment