title: How to parse the json data coming from server side using jQuery in Node.js
body: <p>I m creating a Blood Donation app using Nodejs and express.js.Below is my server site code.</p>
  
  <pre><code>app.post('/SearchDoner', function(request, response) {
    var store;
    console.log('here');
    console.log(request.body);
    console.log(request.body.bg);
    console.log(request.body.c);
    var bg = request.body.bg;
    var city = request.body.c;
    response.setHeader('Content-Type', 'application/json');
    console.log('select txtFullname,gender,email,address,bgp,mno from information   where   bgp =' +"'"+ bg + "'" + "and city =" + "'" + city +"';");
    connection.query('select txtFullname,gender,email,address,bgp,mno from information  where  bgp =' +"'"+ bg + "'" + "and city =" + "'" + city +"';", function(err, rows) {
       response.json(rows);
       console.log(rows);
       });
    });
  </code></pre>
  
  <p>And below is the Client side ajax call :</p>
  
  <pre><code> function fetchDoner()
    { 
   var BloodGroup = $("#dpBloodGroup").children("option").filter(":selected").val();
   var City = $("#dpCity").children("option").filter(":selected").val();
   console.log(BloodGroup);
   console.log(City);
       $.ajax({
          url:"http://127.0.0.1:5000/SearchDoner",
          type: "post",
          dataType: 'json',
          data:({bg:BloodGroup,c:City}),    
          crossDomain: "true",      
          success: function (result) {
              $.each(result,function(index,obj){
            console.log(obj.txtFullname);
                $("#DonerInfo_5").append("&lt;tr&gt;&lt;td style='color:;background: #FDC68F;''&gt;&lt;span&gt;"  + obj.txtFullname + "&lt;/span&gt;&lt;/td&gt;" + "&lt;td style='color:;background: #FDC68F;''&gt;&lt;span&gt;"  +  obj.address + "&lt;/span&gt;&lt;/td&gt;" + "&lt;td style='color:;background: #FDC68F;''&gt;&lt;span&gt;"  +  obj.gender + "&lt;/span&gt;&lt;/td&gt;" +"&lt;td style='color:;background: #FDC68F;''&gt;&lt;span&gt;"  +  obj.mno + "&lt;/span&gt;&lt;/td&gt;" +"&lt;td style='color:;background: #FDC68F;''&gt;&lt;span&gt;"  +  obj.email + "&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;");
        }); 
    var newUrl = 'http://localhost/Blood%20Donation%20Site_1/donerinfo.html';
    document.location.href = newUrl;
           },error: function (obj, txtStatus, error) {
         }
      });
    }
  </code></pre>
  
  <p>The problem is that the json data which is coming from the server site(from app.post() method) is not get parsed at donerinfo.html page.</p>