Javascript - JSON.parse: unexpected end of data - Error when using valid JSON. What am I doing wrong?

前端 未结 1 1635
别那么骄傲
别那么骄傲 2020-12-21 08:40

So, I\'ve found similar questions about JQuery in which you do not need to parse. Since I am using the AJAX XMLHttpRequest, from what I understand, the parse is necessary. T

相关标签:
1条回答
  • 2020-12-21 09:16

    You have to check if jsonGet.readyState==4 && jsonGet.status==200 before parsing the response.

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