Skip to content

Wraps name properties and data in double quotes #5

Merged
merged 1 commit into from Mar 28, 2013
+4 −4
View
8 js/functions.js
@@ -136,18 +136,18 @@ $(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++) {
var currOption = options[j];
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)) {
Something went wrong with that request. Please try again.