projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d955c1f
)
Using native JSON if present
author
Dennis Schafroth
<dennis@indexdata.com>
Thu, 24 Jun 2010 14:43:00 +0000
(16:43 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Thu, 24 Jun 2010 14:43:00 +0000
(16:43 +0200)
js/pz2.js
patch
|
blob
|
history
diff --git
a/js/pz2.js
b/js/pz2.js
index
58cf4a3
..
a78417e
100644
(file)
--- 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
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);
} else {
var err = new Error("XML response is empty but no error " +
"for " + savedUrlForErrorReporting);