JSON for OpenLaszlo is a JSON library for OpenLaszlo.
I wrote this in order to implement my regular expression visualizer.
There’s a live example below. Clicking on a button requests some JSON text from the server and parses it on the client. The source code to the example is here.
(When it runs off my web site, the debugger in the example displays a warning about not being able to connect to the LPS server. This means that the debugger can’t evaluate expressions, as it could if you were running it off the SDK. I’m just using the debugger here to print inspectable representations of the JSON parse results, and the warning doesn’t affect this.)
Rationale
OpenLaszlo implements most of JavaScript 1.5 (ECMAScript 3), but it’s missing regular expressions and throw/catch, so it can’t run JSON in JavaScript. And the OpenLaszlo compiler doesn’t (yet) implement the proposed JavaScript 2.0 (ECMAScript 4) extensions such as class and type declarations, so JSON in ActionScript doesn’t work either. Hence, this implementation, which doesn’t require either regular expressions or JavaScript 2.0 extensions.
It’s open source, of course. (MIT License.)
8 Comments
The link http://osteele.com/sources/openlaszlo/json.zip is not working
Oops! The correct link is http://osteele.com/sources/openlaszlo/json/openlaszlo-json-1.0.zip. I think I’ve updated it everywhere…
[...] Feed « “Stretch” Languages, or, 28 years of programming JSON for OpenLaszlo » [...]
Nice little tool, I’ve just started working with regular expressions myself, your site is very useful.
I’ve tested http://osteele.com/sources/openlaszlo/json/openlaszlo-json-1.0.zip and it’s definitely a working file. Thanks Osteele.
Thanks for the link.
Thanks for info. Very useful to me.
Oops, the source code for the example is not working. (404)