SyntaxError: JSON.parse: unexpected character

后端 未结 2 1765
梦毁少年i
梦毁少年i 2020-12-21 10:30

I have a JSON parse error that I can\'t debug. Code below:

$(document).on(\'submit\', \'#confirmreset\', function(event) {
    event.preventDefault();

    v         


        
2条回答
  •  情书的邮戳
    2020-12-21 11:31

    You don't need to call $.parseJSON if the server is sending valid JSON as jQuery will parse it automatically when it retrieves the response. I don't know the exact criteria, but if you set the Content-type: application/json header it definitely will.

提交回复
热议问题