>> 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
