Closed malaikuangren closed 11 years ago
Thanks! Could you please provide an example? I cannot reproduce this issue. And it actually quite surprises me as the jsoneditor internally calls JSON.stringify() to get property values. Therefore, functions should be stripped down. You can also see this happening in http://jsonmate.com which uses this plugin.
Hi , David , here is what I did. please review it .
var sContent=singletonTemplate.toJsonString(); $('#editor').jsonEditor(singletonTemplate, { change: function() { $('#json').html(sContent); } });
singletonTemplate is a js object which contains the toJsonString() function.(did you notice the first parameter is jsobject?) and toJsonString() just return JSON.stringify(this); so I believe this result definitely without function string output. below is a screenshot . you can see there is a toJsonString in there . please review it .thanks
Yes, and that's correct. Function is not a valid JSON data type, see http://en.wikipedia.org/wiki/JSON.
My question is can I remove them from editor. thanks.
Fixed in ec9fab50bb959afc6b5c464f0c769607fc44c73a.
Thanks you work. It is very nice of you.
Hi, David, firstly I would like to thanks your owesome plugin, I found a issue. please review it . If the jsobject contains the function , the jsoneditor will show them in the tree. how to ignore the function in the editor? thanks.