1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <script type="text/javascript">
var point = { "x": 3, "y": 4, "get": function () { alert(this.x + "," + this.y); } };
var jsonStr = JSON.stringify(point)
console.log(jsonStr)
plainObject = JSON.parse(jsonStr) console.log(plainObject) </script>
|