Sample code for 30+ languages & platforms
Classic ASP

Create JSON Array of Strings

See more JSON Examples

Demonstrates how to create a JSON array of strings.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' The goal of this example is to produce this:

' [
'   "tag1",
'   "tag2",
'   "tag3"
' ]

set jarr = Server.CreateObject("Chilkat.JsonArray")
success = jarr.AddStringAt(-1,"tag1")
success = jarr.AddStringAt(-1,"tag2")
success = jarr.AddStringAt(-1,"tag3")

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

%>
</body>
</html>