Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
hello everyone, I'm writing a multiplayer game and my server is using JSON. question: how to parse JSON in coppercube? In browser or nodejs i can do that: var json = '{"a": "b"}'; but this code not working in coppercube (error: JSON is undefined), coppercube doesn't API to working with JSON? |
||||
|
Hi, Coppercube uses pre es-5 version of js, which doesn't have JSON object api yet. You can use a polyfill. The simplest one would be: JSON = { You can also google json2 and json3, I believe, these implementations could also be adapted to use in Coppercube, but the one above usually works for me. |
||||
|
Oh, it's works, thank you! |
|