From: Dennis Schafroth Date: Fri, 25 Jun 2010 08:52:36 +0000 (+0200) Subject: Attempt to catch issue with parsing JSON. X-Git-Tag: v1.4.4~54 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=259cb95b9ad2d4a604609e2bb2a9db53011f5232;p=pazpar2-moved-to-github.git Attempt to catch issue with parsing JSON. --- 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 " +