success:function in ajax with button onclick code example
Example: write an ajax code to call a function on button click
$("button").click(function(){
$.ajax({url: "demo_test.txt", success: function(result){
$("#div1").html(result);
}});
});