From: Jakub Skoczen Date: Fri, 14 Sep 2007 09:46:49 +0000 (+0000) Subject: Solving bug 1581. X-Git-Tag: PAZPAR2.1.0.3~5 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=10c3439fbb19a8651bfec616372eb51dd4ad74cc;p=pazpar2-moved-to-github.git Solving bug 1581. --- diff --git a/js/pz2.js b/js/pz2.js index 581b77e..1804103 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -1,5 +1,5 @@ /* -** $Id: pz2.js,v 1.56 2007-09-12 08:57:14 jakub Exp $ +** $Id: pz2.js,v 1.57 2007-09-14 09:46:49 jakub Exp $ ** pz2.js - pazpar2's javascript client library. */ @@ -655,7 +655,7 @@ pzHttpRequest.prototype = var el = params; for (var key in el) { if (el[key] != null) { - getUrl += sep + key + '=' + escape(el[key]); + getUrl += sep + key + '=' + encodeURIComponent(el[key]); sep = '&'; } } @@ -669,11 +669,13 @@ pzHttpRequest.prototype = if ( this.request.responseXML && this.request.responseXML.documentElement.nodeName == 'error' && this.request.responseXML.getElementsByTagName("error").length ) { - var errAddInfo = this.request.responseXML.getElementsByTagName("error")[0].childNodes[0].nodeValue; + var errAddInfo = ''; + if ( this.request.responseXML.getElementsByTagName("error")[0].childNodes.length ) + errAddInfo = ': ' + this.request.responseXML.getElementsByTagName("error")[0].childNodes[0].nodeValue; var errMsg = this.request.responseXML.getElementsByTagName("error")[0].getAttribute("msg"); var errCode = this.request.responseXML.getElementsByTagName("error")[0].getAttribute("code"); - var err = new Error(errMsg + ': ' + errAddInfo); + var err = new Error(errMsg + errAddInfo); err.code = errCode; if (this.errorHandler) {