Thanks a lot Mike
On Dec 19, 4:27 pm, Mike Alsup <mal...@gmail.com> wrote: > > I'm using jquery ajax within a custom method and try to return its > > result to that original method but I get nothing while it works fine > > if I show it in alert window > > > here is my code: > > jQuery(document).ready(function() { > > jQuery.Test = function(){ > > jQuery.ajax({ > > type: "POST", > > url: "WebService.asmx/HelloWorld", > > success: function(msg) { > > // alert($("string", msg).text()); //it works fine > > return $("string", msg).text(); //it doesn't works > > }, > > error: function(XMLHttpRequest, textStatus, errorThrown) { > > alert(XMLHttpRequest.responseText); } > > }); > > }; > > alert(jQuery.Test());//it returns 'undefined' > > }); > > This should help: > > http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_get_and_us...- > Hide quoted text - > > - Show quoted text -