07-24-2023, 01:01 AM
I'm getting the error in the title --JSON is null or not an object.
I am inside a classic ASP page. My json2.js file is located in the same directory as this classic asp page that I'm in. So I have no idea why the server can't seem to recognize the JSON.parse() method.
My scripting language is JScript.
I noticed that in a different thread, using the json2.js library is the way to go. But I can't seem to get this to work. Is this a quirk? This should be very straightforward, no?
requestBody is a simple JSON object: [{"answer":"ok"},{"answer":"sunny"}]
Thanks!
<script language="javascript" runat="server" src="json2.js"></script>
<%
var jsonObject = JSON.parse(requestBody);
%>
I am inside a classic ASP page. My json2.js file is located in the same directory as this classic asp page that I'm in. So I have no idea why the server can't seem to recognize the JSON.parse() method.
My scripting language is JScript.
I noticed that in a different thread, using the json2.js library is the way to go. But I can't seem to get this to work. Is this a quirk? This should be very straightforward, no?
requestBody is a simple JSON object: [{"answer":"ok"},{"answer":"sunny"}]
Thanks!
<script language="javascript" runat="server" src="json2.js"></script>
<%
var jsonObject = JSON.parse(requestBody);
%>