Hi,
I am trying to retrieve values from a database by using JQuery Ajax to call a web service routine. The web service routine is set up properly and returns the value I require, however I'm confused about how the jquery ajax works... I don't know how to retrieve the value
$.ajax({
type: 'POST',
url: 'myservices.asmx/getRowName',
dataType: 'xml',
data: ({ param1: someData, param2: someData }),
success: function(data) {
alert( data.getElementsByTagName("string")[0].firstChild.data );
},
error: function(msg) { alert(msg.statusText); }
});
So on the success, I can access the data returned through that function (I've checked and it is returning the right data), but what if I want to use the data outside of that function?
Does $.ajax return anything where I could retrieve the data I need? such as... data = $.ajax({...all the settings...}); or... data = $.ajax({...settings...}).responseText;
Any ideas?