Sample code for 30+ languages & platforms
Classic ASP

Example: JsonObject.NewArrayOf method

See more JSON Examples

Demonstrates the NewArrayOf method.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

big_cats = "[""lion"",""tiger"",""leopard"",""jaguar"",""cheetah"",""snow leopard"",""clouded leopard"",""cougar"",""puma"",""panther""]"

set json = Server.CreateObject("Chilkat.JsonObject")

success = json.UpdateString("test","abc")

success = json.NewArrayOf("big_cats",big_cats)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( json.LastErrorText) & "</pre>"
    Response.End
End If

json.EmitCompact = 0
Response.Write "<pre>" & Server.HTMLEncode( json.Emit()) & "</pre>"

' Result:

' {
'   "test": "abc",
'   "big_cats": [
'     "lion",
'     "tiger",
'     "leopard",
'     "jaguar",
'     "cheetah",
'     "snow leopard",
'     "clouded leopard",
'     "cougar",
'     "puma",
'     "panther"
'   ]
' }

%>
</body>
</html>