javascript - Accessing JSON parsed object -
so here js code: $(document).ready(function() { $.ajax({ url: "/", type:"post", beforesend: function (xhr) { var token = $('meta[name="csrf_token"]').attr('content'); if (token) { return xhr.setrequestheader('x-csrf-token', token); } }, success:function(data){ console.log(data); },error:function(){ console.log("error!!!!"); } }); }); and in console: object { all_creations: "[{"id":"2","user_id":"2","title":"d…" } but i'd like: console.log(data.user_id) but return nothing.. same for: console.log(data['all_creations'].user_id) console.log(data['all_creations'][0].user_id) console.log(data[0].user_id) ... i using laravel5 btw , json object return tojson() function. (if help) ...