Use of Post and Get Method in Jquery

Use of Post and Get Method in Jquery

Use of Post Method in Jquery to Send Data on Button Click

$(document).ready(function(){
$(‘input[id$=”Button Id”]’).click(function(){
var Fname=”Text Value”;

// name is local variable you can use without declaring.
var res=$.post(‘Path of Generic Handler or Webservise’, { name: Fname},
function (result) {
alert(result);
});

rsp.error(function () {
alert(“error”);
return false;

});

});

});

Use of Get Method in Jquery to Get Data on Button Click

$(document).ready(function(){
$(‘input[id$=”Button Id”]’).click(function(){
var res=$.get(‘Path of Generic Handler or Webservise’,

function (result) {
alert(result);
});

});

rsp.error(function () {
alert(“error”);
return false;

});

});

});

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply