Вызов ASP net web services с помощью jquery ajax это ошибка объекта object
Эй кто нибудь пожалуйста помогите мне я вызываю asp net web services используя jquery ajax это задано object Object error как бы я это решил
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="jquery-1.11.2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#btn').click(function () { var empId = $('#txtId').val(); $.ajax({ url: 'EmployeeService.asmx/HelloWorld', data:{ employeeId: empId }, mehtod: 'post', dataType: 'json', success: function (data) { var Name = data.Name; var City = data.City; var Salary = data.Salary; $('#txtName').val(Name); $('#txtCity').val(City); $('#txtSalary').val(Salary); }, error: function (err) { alert(err); } }); }); }); </script> </head> <body> <table> <tr> <td>Id:-</td> <td><input type="text" id="txtId" value="" /></td> </tr> <tr> <td colspan="1"><input type="button" id="btn" value="Submit" /></td> </tr> </table> <table> <tr> <td>Name:-</td> <td><input type="text" id="txtName" value="" /></td> </tr> <tr> <td>City:-</td> <td><input type="text" id="txtCity" value="" /></td> </tr> <tr> <td>Salary:-</td> <td><input type="text" id="txtSalary" value="" /></td> </tr> </table> </body> </html>
Что я уже пробовал:
Hey any one please help me I am calling asp net web services using jquery ajax it's given object Object error how would I solve this <pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="jquery-1.11.2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#btn').click(function () { var empId = $('#txtId').val(); $.ajax({ url: 'EmployeeService.asmx/HelloWorld', data:{ employeeId: empId }, mehtod: 'post', dataType: 'json', success: function (data) { var Name = data.Name; var City = data.City; var Salary = data.Salary; $('#txtName').val(Name); $('#txtCity').val(City); $('#txtSalary').val(Salary); }, error: function (err) { alert(err); } }); }); }); </script> </head> <body> <table> <tr> <td>Id:-</td> <td><input type="text" id="txtId" value="" /></td> </tr> <tr> <td colspan="1"><input type="button" id="btn" value="Submit" /></td> </tr> </table> <table> <tr> <td>Name:-</td> <td><input type="text" id="txtName" value="" /></td> </tr> <tr> <td>City:-</td> <td><input type="text" id="txtCity" value="" /></td> </tr> <tr> <td>Salary:-</td> <td><input type="text" id="txtSalary" value="" /></td> </tr> </table> </body> </html>