How to use Parse.Object fromJSON? [duplicate]

♀尐吖头ヾ 提交于 2021-01-28 19:07:50

问题


I checked the docs: http://parse.com/docs/js/api/classes/Parse.Object.html#methods_fromJSON

And I did this: Parse.Object.fromJSON(this.document), but I get: Uncaught Error: Cannot create an object without a className.

What's the correct way of using this method?

NOTE: console.log(this.document) outputs: Object {} (A Parse object that was previously turned into a JSON object with toJSON.)


回答1:


As the error message says, you're missing a className (in your JSON) that tells it what kind of Parse object it is.



来源:https://stackoverflow.com/questions/34905095/how-to-use-parse-object-fromjson

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!