JavaScript Display the JSON response display json response in html,display json response in html

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

Answer:1

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)
Answer:2

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=...

  1. youtube create playlist missing
  2. youtube create playlist not working
  3. youtube create playlist from channel
  4. youtube create playlist without account
  5. youtube create playlist api
  6. youtube create playlist private
  7. youtube create playlist from liked videos
  8. youtube create playlist from queue
  9. youtube create playlist without channel
  10. youtube create playlist from links
  11. youtube create playlist 2020
  12. youtube create playlist 2019
  13. youtube create playlist mobile
  14. youtube create playlist invalid request
  15. youtube create playlist from search results
  16. youtube create playlist
  17. youtube create playlist from list of urls
  18. youtube create playlist error
  19. youtube create playlist from file
  20. youtube create playlist from search

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: ...

  1. datatables refresh from ajax
  2. refresh datatable with new data
  3. refresh datatable with new json data
  4. refresh datatable with new data jquery
  5. refresh datatable with json data
  6. refresh datatable with jquery
  7. refresh datatable with new data c#
  8. refresh datatable with new data angular
  9. refresh datatable with angularjs
  10. primefaces refresh datatable from bean
  11. primefaces refresh datatable from backing bean
  12. jsf refresh datatable from bean
  13. refresh datatable from backing bean

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 ...

  1. increase element width javascript
  2. increase element width css
  3. increase element width jquery
  4. increase element width
  5. increase element width using javascript