data.replace(/(['"])?([a-zA-Z0-9]+)(['"])?:/g, '"$2":');
That will replace any single quotes on the parameter name, and add any that are missing.
More Related Contents:
- JS: JSON retrieve all JSON data
- How to change data php to javascript json [closed]
- how to parse json array
- jQuery AJAX cross domain
- What is the minimum valid JSON?
- Read local XML with JS
- HTML/Javascript: how to access JSON data loaded in a script tag with src set
- How to test if a string is JSON or not?
- How do you put an image file in a json object?
- Is JSON Hijacking still an issue in modern browsers?
- JSON.stringify without quotes on properties?
- Best content type to serve JSONP?
- Convert JSON string to array of JSON objects in Javascript
- Difference in JSON objects using Javascript/JQuery
- Need Handlebars.js to render object data instead of “[Object object]”
- How to convert HTML to JSON using PHP?
- JavaScript recursive search in JSON object
- How does WebSocket compress messages?
- Parse XLSX with Node and create json
- Is JSON.parse supported by all major browsers? [duplicate]
- How to prevent direct access to my JSON service?
- Combine json arrays by key, javascript
- JSON schema : “allof” with “additionalProperties”
- Alternatives to JavaScript eval() for parsing JSON
- Backbone.js – data not being populated in collection even though fetch is successful
- Access JSON or JS property using string
- Why does JSON.stringify not serialize non-enumerable properties?
- creating highchart with ajax json data
- Dynamically Add Variable Name Value Pairs to JSON Object
- Alternatives of JSON.stringify() in JavaScript