JSON to string in Prototype

后端 未结 2 1823
别那么骄傲
别那么骄傲 2021-01-20 19:30

The people on this website seem to know everything so I figured I would ask this just in case:

Is there a method/function in prototype that converts a JSON object to

相关标签:
2条回答
  • 2021-01-20 20:26

    Assuming you're speaking of Prototype JavaScript framework, why not just use JavaScript's own JSON functionality? JSON does after all stand for JavaScript Object Notation.

    0 讨论(0)
  • 2021-01-20 20:31

    Sure there is: Prototype JSON

    var data = {name: 'Violet', occupation: 'character', age: 25 };
    var myString = Object.toJSON(data);
    // myString = '{"name": "Violet", "occupation": "character", "age": 25}'
    

    Then shove myString into your cookie

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