Parse JSON String in ASP

Tool: http://www.violato.net/blog/others/89-using-classic-asp-library-to-parse-json-data

json_str = {“sorting”:[{“item_id”:”10″,”order”:”0″},{“item_id”:”1″,”order”:”1″}]}
set oJSON = JSON.parse(json_str)
for each item in oJSON.sorting
response.write item.item_id
next

Unfortunately, this tool has weird problems just like other class ASP shit.
For some unknown reason, oJSON.sorting contains 6 items and I gave up finding out what the hell the last four object stand for (Looks like functions)

So, I change my json string a little bit, pass item_count for ASP and just execute specific times.

{“item_count”:”2″,“sorting”:[{“item_id”:”10″,”order”:”0″},{“item_id”:”1″,”order”:”1″}]}
item_count = cLng(oJSON.item_count)

if i >= item_count then exit for end if

 

5 thoughts on “Parse JSON String in ASP

  1. ??? ??????

    If you’re residing in Arizona therefore you have some legal issues that you just feel you can deal with without incurring the expense of any lawyer, then the Arizona suitable forms and legal kits are worth the purchase price. If you have a relatively simple legal issues, such as a no-fault breakup or separation, or writing a previous will and testament, these inexpensive legal forms is a sure answer.

  2. ?????? ??

    After you first contact a journey school, they will lay away the red carpet in your case. You will get a tour belonging to the facilities including the classrooms as well as the airplanes to be used for your in flight training. You will meet wonderful instructors as well as the end of the tour may include a test flight where you get to sit in the pilot’s seat as though were you to actually flying that aeroplanes. That experience alone may hook you to plan to be part of their system. Then they will present you might some colorful brochures, a contract and a class schedule fifth, a schedule of costs in conjunction with payment options.

  3. robert

    What’s up to every single one, it’s truly a good for
    me to pay a visit this web page, it includes useful Information.

Comments are closed.