Reputation: 766
This is not a valid JSON data. But I have to parse it to extract "isNavPaneDisabled". How do I parse it?
var text = {
version: "1.8",
viewid: "RegistrationPage",
browserless: false,
username: "system",
userrole: "NonAdmin",
message: "",
productname: "someApp",
isNavPaneDisabled: true,
isDebug: false
};
Upvotes: 0
Views: 45
Reputation: 4038
The following object isn't in JSON format, but still it's a javaScript object.
console.log(typeof text); // it says text is an object
So you can access the properties of that object. In your case try,
console.log(text.isNavPaneDisabled);
Upvotes: 3