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
(from parent 1:
77659a8
)
Attempt to catch issue with parsing JSON.
author
Dennis Schafroth
<dennis@indexdata.com>
Fri, 25 Jun 2010 08:52:36 +0000
(10:52 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Fri, 25 Jun 2010 08:52:36 +0000
(10:52 +0200)
js/pz2.js
patch
|
blob
|
history
diff --git
a/js/pz2.js
b/js/pz2.js
index
a78417e
..
bae191d
100644
(file)
--- 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 " +