Javascript examples for JSon:JSon Object
Custom function for Json to String function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/* w ww . j a v a2 s . c om*/ obj = { x:555, y: "hi" } obj.myself = obj seen = [] json = JSON.stringify(obj, function(key, val) { if (typeof val == "object") { if (seen.indexOf(val) >= 0) return; seen.push(val); } return val; }) console.log(json); }); </script> </head> <body> </body> </html>