Displaying Data From An Ajax Response With Jquery
Solution 1:
I must admit that i am unfamiliar with the way you use ajax to get a 'response' Are you querying a webservice? And i am not familiar with the Quform plugin either, you should specify that in your question that you are using a plugin.
But i will try and help you anyways. Since your question asked for displaying data from an Ajax response, i will assume that you are querying a webservice and try and help you out with that assumption Here is the code to call a webservice with Ajax without using a plugin.
$.ajax({
url: 'webservice url',
type: "POST",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert('Success!');
$('.ulID').text('response was: ' + data.d)
},
failure: function (msg) {
alert('an error occured');
}
});
The url is offcourse the link to the webservice, and the data contains any parameters that the webservice require.
This is to my knowledge the correct way to use Ajax to query a webservice.
if you want help with getting help with the code you already have i suggest removing Ajax from the question and replacing it with Quform. But to be honest, Ajax calls in JQuery are so easy that unless you plan on using that plugin for something else i'd drop the plugin.
btw: this setup expects the webservice to support json
i hope this helps
Post a Comment for "Displaying Data From An Ajax Response With Jquery"