Decode/Encode JSON with VBScript

As JSON is a hierarchical data format, using Regular expressions and Split(), as Peter proposed, won't get you far.

If your environment allows CreateObject() you may be able to use a ready made COMponent written in another language (e.g. wrap the standard json2.js in a .WSC or COM enable a .NET DLL). Another option would be to harness another language via the Microsoft Script Control. The con of this approach is that you'll have to deal with the objects/arrays delivered by the other language (some hints are to be found in the topic Peter refered to).

A pure VBScript solution can be found here. I can't read the documentation, but the code compiles and 'works' for simple test cases - YMMV.


How about doing this with ASPJSON?
Available from http://www.aspjson.com/

I'm about to use this as a solution for a very old site to send an ajax call (using Jquery) with the encoded data to a MongoDB, for testing.

Tags:

Vbscript

Json