json.parse gives Uncaught SyntaxError: Unexpected Token (Django json serialized queryset)

前端 未结 1 599
长发绾君心
长发绾君心 2021-01-06 22:27

I am experiencing the error Uncaught SyntaxError: Unexpected Token when trying to parse the json data

This is my ajax code (json2.js):

          


        
1条回答
  •  说谎
    说谎 (楼主)
    2021-01-06 22:51

    When you set dataType to json, jQuery parses the data for you. So you don't need to put it through JSON.parse, you can just refer to data as a normal Javascript object.

    0 讨论(0)
提交回复
热议问题