반응형
asp - JSON : http://www.aspjson.com/
ASPJSON is a free to use project for generating and reading JSON data into a classic ASP object.
The class can be used for reading a string of JSON data as well as writing JSON output from an AJAX file.
Below are 2 simple examples of both.
<!--#include virtual="/aspJSON1.17.asp" --> <% Set oJSON = New aspJSON 'Load JSON string oJSON.loadJSON(jsonstring) 'Get single value Response.Write oJSON.data("firstName") & "<br>" 'Loop through collection For Each phonenr In oJSON.data("phoneNumber") Set this = oJSON.data("phoneNumber").item(phonenr) Response.Write _ this.item("type") & ": " & _ this.item("number") & "<br>" Next 'Update/Add value oJSON.data("firstName") = "James" 'Return json string Response.Write oJSON.JSONoutput() %>
[INPUT]{ "firstName": "John", "lastName" : "Smith", "age" : 25, "address" : { "streetAddress": "21 2nd Street", "city" : "New York", "state" : "NY", "postalCode" : "10021" }, "phoneNumber": [ { "type" : "home", "number": "212 555-1234" }, { "type" : "fax", "number": "646 555-4567" } ] }
반응형
'프로그래밍 > Web' 카테고리의 다른 글
[javascript] UILang: A UI-focused programming language (0) | 2014.09.05 |
---|---|
[javascript] QUnit: A JavaScript Unit Testing framework. (0) | 2014.09.05 |
[javascript] Duo.js: A next-gen front-end package manager (0) | 2014.09.03 |
[javascript] Chart & javascript - C3.js: A D3 reusable chart library (0) | 2014.09.03 |
[MockUp] http://ninjamock.com/ - Mockup 도구 (0) | 2014.09.03 |