0

I am using the JSON object with jquery in asp.net application. The code is working with VS2008 but when i moved sam code in VS2003 then it is showing the JSON is undefined. Code is following

var mes = $('#filePath').val();
alert("File Path: " + mes);
var jsonText = JSON.stringify({ sFilePath: mes });

In third line it is giving the error : Microsoft JScript runtime error: 'JSON' is undefined

Can any one help on this. Do i need to add any reference.

Thanks in Advance Eshwer N

Eshwer
  • 153
  • 1
  • 5
  • 15

1 Answers1

3

This does not smell like an ASP.NET issue. Rather try including the json2.js as part of your script tags -

http://www.json.org/

https://github.com/douglascrockford/JSON-js

http://www.json.org/js.html

<script src="http://wherever.com/json2.min.js" type="text/javascript"></script>
Kris Krause
  • 7,304
  • 2
  • 23
  • 26