aspjson – JSON for ASP

aspjson – JSON for ASP – Google Project Hosting.

sample

<!--#include file="JSON_latest.asp"-->
<%
Dim member
Set member = jsObject()

member("name")="Tuğrul"
member("surname")="Topuz"
member("message")="Hello World"

member.Flush
%>

output

{"name":"Tu\u011Frul","surname":"Topuz","message":"Hello World"}

SQL Queries

sample

<!--#include file="JSON_latest.asp"-->
<!--#include file="JSON_UTIL_latest.asp"-->
<%
QueryToJSON(dbconn,"SELECT name, surname FROM members WHERE age < 30").Flush
%>

output

[
    {
        "name":"ali",
        "surname":"osman"
    },
    {
        "name":"mahmut",
        "surname":"\u00E7\u0131nar"
    }
]

Multi Dimensional Arrays

sample

<!--#include file="JSON_latest.asp"-->
<%
Dim a(1,1)

a(0,0)="zero - zero"
a(0,1)="zero - one"
a(1,0)="one - zero"
a(1,1)="one - one"

Response.Write toJSON(a)
%>

output

[["zero - zero","zero - one"],["one - zero","one - one"]]
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s