Unable to solve error “ Uncaught SyntaxError: Unexpected token o ”

前端 未结 4 1617
栀梦
栀梦 2020-12-21 13:02

I am currently practicing using Javascript/Dojo. However, I have an error that I am unable to solve:

Uncaught SyntaxError: Unexpected token o

4条回答
  •  太阳男子
    2020-12-21 13:40

    Error is once declared as datatype json, it parses for you.

    so : it would be something like this

    var obj = JSON.parser(data)
    
     success: function(data){
    
      var obj = JSON.parser(data)
    
      alert(obj.data)
    
    }
    

提交回复
热议问题