From 4ef7354fed378c894ab1b23ac0c79989088f9f65 Mon Sep 17 00:00:00 2001 From: Chris Dary Date: Sat, 21 May 2011 08:42:32 -0400 Subject: [PATCH] Updating to use the JSON.parse parser after validation to avoid extra backslashes. --- c/js/jsl.interactions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c/js/jsl.interactions.js b/c/js/jsl.interactions.js index 6d800923..ab48750e 100644 --- a/c/js/jsl.interactions.js +++ b/c/js/jsl.interactions.js @@ -107,7 +107,7 @@ jsl.interactions = (function () { result; jsonVal = $('#json_input').val(); - + try { result = jsl.parser.parse(jsonVal); @@ -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.");