I’ve got a rapid development tool for an ERP-system, which allows only vbscript. I’m trying to create a simple AJAX-Request with VBS. That worked with the “Microsoft.XMLHTTP”-object.
Next step is to receive data from a webserver using json. But in VBS there seems to be no function like “json_decode” oder other.
Does anyone know a solution? Or is the only option to develop my own json-function?
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.