• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
返回主页

自由无价

  • 博客园
  • 首页
  • 新随笔
  • 联系
  • 订阅
  • 管理

json for asp

JSON engine of VBScript based ASP server technology, served on it's deficiency of processing speciality. Also there have been like these projects put they had some deficiencies. For instance

  • find result late
  • difficult application
  • don't support full UNICODE
  • don't compatible with primitive datatypes
  • don't support to multi dimensional arrays
  • isn't extendable and iteratable

This project solved all these matters.

Hello World !

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"]]
posted @ 2009-04-20 16:37  自由无价  阅读(350)  评论(0)    收藏  举报
刷新页面返回顶部

公告

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3