when call the webservice using jquery every time it shown error with googlecrome
what is the problem.
var param = 'firstname=' + firstname+ '&dob=' + dob + '&mobileno=' + mobileno
$.ajax({ type: "POST", url: "MyWebService.asmx/SayHello", data:param ,
//contentType: "application/x-www-form-urlencoded; charset=UTF-8", // if you are using form encoding, this is default so you don't need to supply it dataType: "text", // the data type we want back, so text. The data will come wrapped in xml success: function (data) { $("#searchresultsA").html(data); // show the string that was returned, this will be the data inside the xml wrapper }
error:function(a,b,c)
{
} });
Anubhav ChaudharyPosted Dec 2, 2014, 12:08 AM
You should try this code:
But remember that SyaHello should not be receiving any type of parameters means SayHello() should be clear, even if SayHello(string param) is written then also it will give you an error in the console because you are not sending any type of parameter "param" from jQuery.
You can check the error in the console of browser, or write "debugger" in success and in error, so that you can check what type of error you are getting.