ajax pass data code example
Example 1: jquery ajax $.post with data
$.post('http://example.com/form.php', {category:'client', type:'premium'}, function(response){
alert("success");
$("#mypar").html(response.amount);
});
Example 2: passing data variable using ajax
var myVar = "test";
$.ajax({
url: "test.php",
type: "POST",
data:{"myData":myVar}
}).done(function(data) {
console.log(data);
});