How to display the JSON response in jsp page through ajax...
function doAjaxPost() {
var name = $('#name').val();
var password = $('#password').val();
var gender = $('#gender').val();
var aboutYou = $('#aboutYou').val();
$.ajax({
type: "POST",
url: "add.htm",
data: "name=" + name + "&password=" + password + "&gender=" + gender + "&aboutYou=" + aboutYou,
success: function(response){
alert('name : '+response);
},
error: function(e){
alert('Error: ' + e);
}
});
Here in this alert('name : '+response); I get the response ,but i want to display on this jsp page.. This is form data which i have to display...plz help..thanks in advance
You need to parse the json data using json parser and then populate tables..!
var resultData = JSON.parse(response);
//resultDate will ve json object in the form of JS objects
resultData.membervalues (or arrays)
Description: Using Javascript, I populate a YouTube link with video IDs that the user has selected, and end up with a URL like the following: https://www.youtube.com/watch_videos?video_ids=...
Description: Using Javascript, I populate a YouTube link with video IDs that the user has selected, and end up with a URL like the following: https://www.youtube.com/watch_videos?video_ids=...
I'm extending the DataTables defaults like so: $.extend(true, $.fn.dataTable.defaults, { lengthChange: false, deferRender: true, displayLength: 25, stateSave: false, serverSide: ...
I'm extending the DataTables defaults like so: $.extend(true, $.fn.dataTable.defaults, { lengthChange: false, deferRender: true, displayLength: 25, stateSave: false, serverSide: ...
I trying to implement keyup function for dynamically added input fields, but it is not working html code <table border="1" id="table"> <colgroup> <col width="100"/> <col width="...
I trying to implement keyup function for dynamically added input fields, but it is not working html code <table border="1" id="table"> <colgroup> <col width="100"/> <col width="...
This answer by Varinder works well but I would like to get the element width which is set in pixels and increase it by 10%. $(window).load(function() { $(".ml").each(function() { // this is ...
This answer by Varinder works well but I would like to get the element width which is set in pixels and increase it by 10%. $(window).load(function() { $(".ml").each(function() { // this is ...