From 6dec6061f0670a494291e704743581e62d51f681 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 24 Jun 2010 16:43:00 +0200 Subject: [PATCH] Using native JSON if present --- js/pz2.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/pz2.js b/js/pz2.js index 58cf4a3..a78417e 100644 --- a/js/pz2.js +++ b/js/pz2.js @@ -805,8 +805,13 @@ pzHttpRequest.prototype = this.request.responseXML == null) { if (this.request.responseText != null) { //assume JSON - var json = eval("(" + this.request.responseText + ")"); - this.callback(json, "json"); + + var json = null; + if (this.JSON == null) + json = eval("(" + this.request.responseText + ")"); + else + json = JSON.parse(this.request.responseText, null); + this.callback(json, "json"); } else { var err = new Error("XML response is empty but no error " + "for " + savedUrlForErrorReporting); -- 1.7.10.4