Fix #4 Compatibility with Microsoft Edge

This commit is contained in:
Misode
2019-08-03 17:02:10 +02:00
parent 412b44f917
commit 8a8e0cacd7
+3 -3
View File
@@ -55,7 +55,7 @@ function updateSouce() {
$('#source').removeClass('invalid'); $('#source').removeClass('invalid');
try { try {
table = JSON.parse($('#source').val()); table = JSON.parse($('#source').val());
} catch { } catch(e) {
if ($('#source').val().length > 0) { if ($('#source').val().length > 0) {
$('#source').addClass('invalid'); $('#source').addClass('invalid');
return; return;
@@ -422,7 +422,7 @@ function parseJSONValue(value) {
if (value.startsWith('"') || value.startsWith('{') || value.startsWith('[')) { if (value.startsWith('"') || value.startsWith('{') || value.startsWith('[')) {
try { try {
return JSON.parse(value); return JSON.parse(value);
} catch { } catch(e) {
return value; return value;
} }
} }
@@ -575,7 +575,7 @@ function updateChancesField(el) {
parent.chances[i] = 1; parent.chances[i] = 1;
} }
} }
} catch { } catch(e) {
parent.chances = []; parent.chances = [];
} }
invalidated(); invalidated();