var formData = {name:"John"}; //Array
$.ajax({
url : "https://cracknns.com/random", // Url of backend (can be python, php, etc..)
type: "POST", // data type (can be get, post, put, delete)
data : formData,
method:'post', // data in json format
async : false, // enable or disable async (optional, but suggested as false if you need to populate data afterwards)
success: function(response, textStatus, jqXHR) {
console.log(response);
window.location = response;
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
});
Social Plugin
Social Plugin