Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Classic ASP server-side JSON library

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 I do this?

like image 534
dreftymac Avatar asked Feb 18 '10 22:02

dreftymac


1 Answers

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>
like image 59
Cheeso Avatar answered Oct 29 '22 01:10

Cheeso