X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=js%2Fpz2.js;fp=js%2Fpz2.js;h=bae191d5a873953a2b80a0a0b0879ca9391f20cf;hb=259cb95b9ad2d4a604609e2bb2a9db53011f5232;hp=a78417e2aa8be6a199375e89122ea20797a255b9;hpb=77659a8b193d49d6353e508a647df20cdfd0a7e4;p=pazpar2-moved-to-github.git 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 " +