0

I am using jquery 1.3.2 and I can't use the parseJSON since it is added in 1.4.1 & I can't upgrade right now.

Is there any wat to get JSON object from string?

If this is a duplicate please send me the link.

Thanks for reading

0

2 Answers 2

2

You can use a couple of options, see here

  • Javascript eval function
  • JSON.parse() function

The eval function has some security issues associated with it, and the JSON.parse function has its own set of incompatibilities. I guess this is why JQuery has its own wrapper function. If you can't use JQuery 1.4+ though, these are two of your best options, without going looking for a specific JSON parsing library.

Sign up to request clarification or add additional context in comments.

1 Comment

I am having a similar function jquery has. temporary.
1

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

2 Comments

This is the author comment on this file:On current browsers, this file does nothing, prefering the built-in JSON object. Does this mean it won't work with latest browser?
No, it means that the Browser specific JSON object will take precedence over the javascript object. This means you get backward compatibility with browsers that do not have the JSON object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.