Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Wraps name properties and data in double quotes #5

Merged
merged 1 commit into from

2 participants

@abhishekbhardwaj

Wraps name properties and data in double quotes to make it generate
valid JSON code.

@abhishekbhardwaj abhishekbhardwaj Wraps name properties and data in double quotes
Wraps name properties and data in double quotes to make it generate
valid JSON code.
8f5e17b
@peric peric merged commit a592d51 into peric:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2013
  1. @abhishekbhardwaj

    Wraps name properties and data in double quotes

    abhishekbhardwaj authored
    Wraps name properties and data in double quotes to make it generate
    valid JSON code.
This page is out of date. Refresh to see the latest.
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)) {
Something went wrong with that request. Please try again.