KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I convert a string that describes an object into a JSON string using JavaScript (or jQuery)? e.g: Convert this ( NOT a valid JSON string): var str = "{ hello: 'world', places: ['Africa', 'America', 'Asia', 'Australia'] }" into this: str = '{ "hello": "world", "places": ["Africa", "America", "Asia", "Australia"] }' I would love to avoid using eval() if possible.
Tags (comma-separated)
Save Edits
Cancel