Uncaught SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse

前端 未结 2 1775
一向
一向 2021-01-28 15:22

I\'m trying to learn JavaScript and I keep getting the error \"Uncaught SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse\".

var ourRequest = n         


        
相关标签:
2条回答
  • 2021-01-28 15:28

    You've simply misspelt resoponseText - It should be responseText. You get the error because JavaScript ends up calling JSON.parse("undefined").

    0 讨论(0)
  • 2021-01-28 15:43

    You have a typo: you wrote ourRequest.resoponseText rather than ourRequest.responseText.

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