I am sending data using json when user does certain evens with the help of following code.
console.log(" Ajax post");
$.ajax({
url: 'https://www.abc123.com/xyz',
type: 'POST',
dataType: 'json',
data: {
"md" : qm["nd"],
"url" : ngurl,
"data" : sendpts
},
success: function(a){
console.log("success");
console.log(a.message);
},
error: function(request, status, error) {
console.log("error");
}
});
Is there any way to send json data when the webpage gets closed along with the notification that the webpage was closed?