title: Accessing individual values from json array in jquery ajax
body: <p>I have an array returned by AJAX in jQuery. I wanted to iterate through the AJAX success result and take individual values from the JSON array. The data is returned in the form of a string. I'm using jQuery's <code>$.ajax</code> to get it from the server, which works fine.</p>
  
  <pre><code>//my View
  $.ajax({
      type: "POST",
      url:"http://localhost:8888/CodeIgniter/index.php/user/usercontroller/search",//controller function
      cache: false,
      data:{"responsible1":res1},
      success: function(data21) { 
          alert(data21);
      });
  });
  </code></pre>
  
  <blockquote>
  <pre><code>//data 21 alerts the following
  {"taskname":"Coding","projname":"Easy Wedding"} 
  {"taskname":"Maintain","projname":"Easy Wedding"}
  {"taskname":"Flow Chart","projname":"Fnn"}
  {"taskname":"development in ","projname":"Fnn"}
  {"taskname":"flow chart","projname":"Art gallery"}
  </code></pre>
  </blockquote>
  
  <p>How can I access only individual <code>taskname</code> and <code>projectname</code> or how can I convert <code>data21</code> to an array</p>