ASP Classic: der Iteration einer json2.js Objekt

Ich bin immer ein JSON-Ergebnis in ASP-Classic so:

<script language="JScript" runat="server" src="json2.js"></script>
<%
Response.ContentType = "text/html"

Dim HttpReq
Dim Diamond
Set HttpReq = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0")
HttpReq.open "GET", "http://url.com?id=" & Request.QueryString("id"), False
HttpReq.send

res = HttpReq.responseText
Set res = JSON.parse(res)
%>

Es funktioniert.

Sagen wir mal das JSON-Ergebnis wird wie folgt Aussehen:

res = {
    gallery: { 
        image1: { img: 'source url', thumb: 'source url' },
        image2: { img: 'source url', thumb: 'source url' },
        image3: { img: 'source url', thumb: 'source url' }
    },
    another_param1: 'foo',
    another param2: 'bar',
    ...
}

Möchte ich iteriere die gallery-Objekt, nicht in JScript, aber in VBScript.

Wie kann ich das tun?

Vielen Dank im Voraus.

InformationsquelleAutor pilau | 2012-05-28

Schreibe einen Kommentar