title: Get object value with Ajax request
body: <p>I'm building a nice app with CodeIgniter and Ajax JQuery which returns finally a nice JSON like object looking like the following out of the success function via <code>console.log ()</code>:</p>
  
  <pre><code>        var data2 = {"field":fieldname,
                  "pagetitle":userdata};
          $.ajax({
                  type: "POST",
                  url: "getdata_ajax",
                  dataType: 'json',
                  data: data2,
                  success: function(data) {
                     console.log(data);
                  }
              }); 
  </code></pre>
  
  <p>The result of the success function:</p>
  
  <p><img src="https://i.stack.imgur.com/a9rIK.jpg" alt="enter image description here"></p>
  
  <p>Since quite a while I'm trying to get just one value out of that object. I tried</p>
  
  <ul>
  <li><code>console.log (data.id)</code> </li>
  <li><code>console.log (data[id])</code> </li>
  <li>etc</li>
  </ul>
  
  <p>but nothing worked. I'm sure its just a stupid thing. Any help?</p>