I have a simple jQuery AJAX method that send data to a web method which brings data from da database. When I send number it works properly but I don't know how to send data with parameter.
For example this method works properly:
function catchdata() {
$.ajax({
type: "POST",
url: "rank.aspx/bringdata",
data: "{lmt:16}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function(ret){
s = ret.d;
dos(s, 0);
},
error: function(x,e){
alert("error occur");
}
});
}
But this below code does not work and error function raise:
function catchdata() {
$.ajax({
type: "POST",
url: "rank.aspx/bringdata",
data: {
lmt:total
},
async: true,
cache: false,
success: function(ret){
s = ret.d;
dos(s, 0);
},
error: function(x,e){
alert("error occur");
}
});
}