Jquery - Ajax: SyntaxError: JSON.parse: unexpected character

后端 未结 3 1600
闹比i
闹比i 2021-01-27 09:36

I have the following code and output, and I cant fine any error on the json data to be decoded. Can anyone please help me in finding this error

CODE:

            


        
3条回答
  •  花落未央
    2021-01-27 10:21

    data returned already json format only,

        $.ajax({
           'type': 'get',
           'data': {},
           'dataType': 'json',//Return Json Format
           'url': 'dashboard/data/',
           'complete': function(data) {
               //data returned already json format only
               //var top10Value = JSON.parse(data);
               $.each(top10Value, function(key,value){
                   console.log(key+" -- "+value);
               });
    
           }
       });
    

提交回复
热议问题