Im trying to parse a json string in classic asp. A found a useful script referenced on stackoverflow: https://github.com/douglascrockford/JSON-js/blob/master/json2.js
when calling the 'parse' function I get an error:
<script language="JScript" runat="server" src="json2.js"></script>
'line 144 of my script
Set myJSON = JSON.parse(versionsStr)
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "[{"self":"https://dc"]'
/libs/asp/common/jira_api.asp, line 144
Here is my json string (versionStr):
[{"self":"https://server.com:8343/rest/api/2/version/10300","id":"10300","description":"baseline version","name":"1.0","archived":false,"released":true,"releaseDate":"2013-11-07","userReleaseDate":"07/Nov/13"},{"self":"https://server.com:8343/rest/api/2/version/10301","id":"10301","description":"sample version","name":"1.1.0","archived":false,"released":false},{"self":"https://server.com:8343/rest/api/2/version/10302","id":"10302","name":"3.0.0","archived":false,"released":false}]
Im guessing that the script Im using is expecting a json object, but my calls to the jira API are returing json strings. Does someone have a solution that parses a json string into a classic asp array?