0
我試圖解析經典asp中的json字符串。 A中的計算器引用一個有用的腳本:https://github.com/douglascrockford/JSON-js/blob/master/json2.js調用 '解析' 功能時解析經典ASP中的json字符串
我得到一個錯誤:
<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
這裏是我的JSON字符串(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}]
林猜測我使用的腳本需要一個json對象,但是我對jira API的調用正在迴應json字符串。有人有解決方案,將json字符串解析爲經典的asp數組嗎?
這些提供任何線索嗎? http://stackoverflow.com/questions/1019223/any-good-libraries-for-parsing-json-in-classic-asp,http://code.google.com/p/aspjson/ – John
我已經在那裏。這導致我使用了json2.js腳本。 – prufrock
versionsStr來自哪裏? – John