Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Wraps name properties and data in double quotes

Wraps name properties and data in double quotes to make it generate
valid JSON code.
  • Loading branch information...
commit 8f5e17babf6ff2b5bf24a21e4b1fd868da4f7e23 1 parent 98a5388
@abhishekbhardwaj abhishekbhardwaj authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/functions.js
View
8 js/functions.js
@@ -136,8 +136,8 @@ $(document).ready(function () {
$('#generatedcode').text(xml);
} else if (settings.type === "jsontype") {
json += "{";
- json += "\n\tcountries: {";
- json += "\n\t\tcountry: [";
+ json += "\n\t\"countries\": {";
+ json += "\n\t\t\"country\": [";
for(var i = 0; i < valuesLength; i++) {
json += "\n\t\t\t{";
for (var j = 0; j < oLength; j++) {
@@ -145,9 +145,9 @@ $(document).ready(function () {
var currValue = allValues[i][options[j]];
if (j == (oLength - 1)) {
- json += "\n\t\t\t\t" + currOption + ": '" + currValue + "'";
+ json += "\n\t\t\t\t\"" + currOption + "\": \"" + currValue + "\"";
} else {
- json += "\n\t\t\t\t" + currOption + ": '" + currValue + "',";
+ json += "\n\t\t\t\t\"" + currOption + "\": \"" + currValue + "\",";
}
}
if (i == (valuesLength - 1)) {
Please sign in to comment.
Something went wrong with that request. Please try again.