Using jQuery AJAX to fetch data from a database through a web service -
I'm trying to get value from the database using JQuery Ajax to call a web service routine. The web service routine is set up properly and the value I need is still confused about how jquery ajax works ... I do not know how to get the price
So on success, I can access the returned data through that function (I have checked and it is returning the right data), but what if I Want to use that out?
Does $ .jax return anything, where can I get the required data? Like ...
data = $ .ajax ({... all settings ...}); or ...
data = $ AJAX ({... settings ...}). Reaction text; Any ideas?
What suggestions are you doing that you want AJAX to have an asynchronous process and AJAX Trying to specify the outcome of the call in a variable such that the code will be required to "hang" until the result is returned. It's not how I work with JavaScript. Most of the time I do my data successfully in the callback. If this is not enough, the way to do this is to have a function that accepts the data as logic and call it when you are done. If you are coming from other languages, it may sound strange to you, but many things are based on JavaScript ("this happens when this happens"), so you have to set up your code accordingly :
function doStuffWithData (data) {/ / whatever you want} $ .ense ({type: 'POST', url: 'myservices.asmx / getRowName', datatype: 'xml ', Data: ({param1: some data, absolute 2: some data}), success: work (data) {doStuffWithData (data);}, error: task (msg) {warning (msg.stat UsText);}});
Comments
Post a Comment