Classic ASP server-side JSON library

前端 未结 4 1713
情深已故
情深已故 2020-12-16 23:28

I have inherited some Classic ASP code and I need a JSON library that can be instantiated and run server-side for use with JavaScript-coded server-side ASP.

How can

相关标签:
4条回答
  • 2020-12-16 23:44

    I've used aspjson with great success.

    http://code.google.com/p/aspjson/

    0 讨论(0)
  • 2020-12-17 00:06

    For writing/outputting JSON i believe the aspjson project is a pretty good choice. Parsing JSON in ASP "classic" is discussed here:

    • Any good libraries for parsing JSON in Classic ASP?

    In that thread, Chris Nielsen has a creative idea of using a Javascript library on the server side (as ASP supports JScript as well as VBScript). I have not tried it, but maybe that could solve both parsing and writing.

    0 讨论(0)
  • 2020-12-17 00:09

    In my experience, JSON2.js works in Classic ASP.

    To use it, I do this in the .asp code:

    <%@ language="Javascript" %>
    
    <script language="javascript" runat="server" src='json2.js'></script>
    
    <script language="javascript" runat="server">
    
       ... my code here....
    
       // use the JSON object:
       var jsonRepresentation = JSON.stringify(myObject, null, 2);
    
    </script>
    
    0 讨论(0)
  • 2020-12-17 00:09

    You could try something similar to this: http://www.lshift.net/blog/2005/10/11/simple-ajax-with-json-chat-application-for-asp-30

    It has a fairly direct encapsulation of the old json.js into a json.asp file for running on the server-side.

    0 讨论(0)
提交回复
热议问题