Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Updating to use the JSON.parse parser after validation to avoid extra…
Browse files Browse the repository at this point in the history
… backslashes.
  • Loading branch information
umbrae committed May 21, 2011
1 parent 7c2750d commit 4ef7354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions c/js/jsl.interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jsl.interactions = (function () {
result;

jsonVal = $('#json_input').val();

try {
result = jsl.parser.parse(jsonVal);

Expand All @@ -117,11 +117,11 @@ jsl.interactions = (function () {
$('#results').text('Valid JSON');

if (reformat) {
$('#json_input').val(JSON.stringify(result, null, " "));
$('#json_input').val(JSON.stringify(JSON.parse(jsonVal), null, " "));
}

if (compress) {
$('#json_input').val(JSON.stringify(result, null, ""));
$('#json_input').val(JSON.stringify(JSON.parse(jsonVal), null, ""));
}
} else {
alert("An unknown error occurred. Please contact Arc90.");
Expand Down

0 comments on commit 4ef7354

Please sign in to comment.