From 259cb95b9ad2d4a604609e2bb2a9db53011f5232 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Fri, 25 Jun 2010 10:52:36 +0200 Subject: [PATCH] Attempt to catch issue with parsing JSON. --- js/pz2.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/pz2.js b/js/pz2.js index a78417e..bae191d 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -809,8 +809,13 @@ pzHttpRequest.prototype = var json = null; if (this.JSON == null) json = eval("(" + this.request.responseText + ")"); - else - json = JSON.parse(this.request.responseText, null); + else { + try { + json = JSON.parse(this.request.responseText, null); + } + catch (e) { + json = eval("(" + this.request.responseText + ")"); + } this.callback(json, "json"); } else { var err = new Error("XML response is empty but no error " + -- 1.7.10.4