Parsing JSON giving "unexpected token o" error [duplicate] Parsing JSON giving "unexpected token o" error [duplicate] json json

Parsing JSON giving "unexpected token o" error [duplicate]


Your data is already an object. No need to parse it. The javascript interpreter has already parsed it for you.

var cur_ques_details ={"ques_id":15,"ques_title":"jlkjlkjlkjljl"};document.write(cur_ques_details['ques_title']);


Try parse so:

var yourval = jQuery.parseJSON(JSON.stringify(data));


Using JSON.stringify(data);:

$.ajax({    url: ...    success:function(data){        JSON.stringify(data); //to string        alert(data.you_value); //to view you pop up    }});