incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janne Jalkanen <janne.jalka...@ecyrd.com>
Subject Re: Seperate thread on JSON and AJAX
Date Mon, 08 Mar 2010 17:18:49 GMT
>> I do not understand why a simple 'buildJSON' is not part of the API of
>> their JavaScriptResolution class.
> 
> Good question. But it's not, so we will have to do something, then. :)
> How hard can it be? Would it be as simple as the example you gave?
> (Maybe just escape all of the single quotes in the three HTML
> strings?)

Writing a JSONResolution is really simple, BTW. Have done it for corporate purposes (so can't
cut-n-paste the code, unfortunately, and partly therefore would prefer if someone else did
it). The reason why Stripes does it the way it does is because this way it can marshal e.g.
circular references and other goodies. So it's a very generic system that works with pretty
much everything, and can be eval()ed nicely. However, doing eval() is generally discouraged
(it's a potential security hole) and therefore many JS libs are already using either the native
JSON parser or roll their own.

/Janne
Mime
View raw message