经典的ASP服务器端JSON库

时间:2022-11-07 01:46:35

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.

我继承了一些经典ASP代码,我需要一个可以实例化的JSON库,并在服务器端运行,以便与JavaScript编码的服务器端ASP一起使用。

How can I do this?

我怎样才能做到这一点?

4 个解决方案

#1


5  

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

为了编写/输出JSON,我相信aspjson项目是一个不错的选择。这里讨论解析ASP“经典”中的JSON:

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.

在该主题中,Chris Nielsen有一个创造性的想法,即在服务器端使用Javascript库(因为ASP支持JScript和VBScript)。我没有尝试过,但也许这可以解决解析和写作问题。

#2


8  

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

根据我的经验,JSON2.js适用于Classic ASP。

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

要使用它,我在.asp代码中执行此操作:

<%@ 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>

#3


2  

I've used aspjson with great success.

我已经使用了aspjson取得了巨大的成功。

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

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

#4


1  

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

你可以尝试类似的东西: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.

它将旧的json.js直接封装到json.asp文件中,以便在服务器端运行。

#1


5  

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

为了编写/输出JSON,我相信aspjson项目是一个不错的选择。这里讨论解析ASP“经典”中的JSON:

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.

在该主题中,Chris Nielsen有一个创造性的想法,即在服务器端使用Javascript库(因为ASP支持JScript和VBScript)。我没有尝试过,但也许这可以解决解析和写作问题。

#2


8  

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

根据我的经验,JSON2.js适用于Classic ASP。

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

要使用它,我在.asp代码中执行此操作:

<%@ 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>

#3


2  

I've used aspjson with great success.

我已经使用了aspjson取得了巨大的成功。

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

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

#4


1  

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

你可以尝试类似的东西: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.

它将旧的json.js直接封装到json.asp文件中,以便在服务器端运行。