$.post('http://example.com/form.php', {category:'client', type:'premium'}, function(response){
alert("success");
$("#mypar").html(response.amount);
});
<script>window.onload = function(){
let aData = {"profile": "developer", "to": "[email protected]"};
console.log(FormData);
$.ajax({
type: "POST",
url: "/api/saveProfile",
data: JSON.stringify(aData),
contentType: "application/json",
success: function(){
alert("Request was successful");
}
});
};