JSON to string in Prototype

后端 未结 2 1855
别那么骄傲
别那么骄傲 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: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

提交回复
热议问题