Hey guys,
I'm fairly new to jquery, currently using it for an assignment and I'm asking if maybe anyone came across a solution to the following problem.
I am experiencing a delay when calling an asp.net webserivce that is displaying the output on the web page as "undefined".
The job of the web service is to call a method to get a particular value from MySQL. The value that I want is being returned because when I use alert(response.d), the value shows up. but when I do:
- $.ajax({
- type: "POST",
- url: "tableID.asmx/getLastID",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (response) {
- return response.d;
- },
- Error: function (msg) { alert(msg); }
- });
With the above, I'm getting undefined and this is all because of this delay. When I use firebug to debug the code and I take my time, the value that I want comes up.
If you guys knows about a solution, you'd do me a great big favour! thanks :D