jbutko
7/10/2014 - 8:28 PM

jQuery, AJAX: Send AJAX Post request with parameters

jQuery, AJAX: Send AJAX Post request with parameters

$.ajax({
	type: "POST", /* Method */
	contentType: "application/json; charset=utf-8",
	url: "http://expressprefixr.herokuapp.com/api/processor",
	data: '{"css":"box-sizing:border-box"}', /* Parameters that will be sent */
	dataType: "json",
	success: function(data) {
		console.log("Success");
		console.log(data); /* console.log data we get from response */
	}, error: function(data) {
		console.log("Error");
	}
});