Author: chabotc
Date: Thu May 22 12:13:13 2008
New Revision: 659213
URL: http://svn.apache.org/viewvc?rev=659213&view=rev
Log:
leftover issue from the ContentType.FEED io.js.patch from SHINDIG-60
Modified:
incubator/shindig/trunk/features/core.io/io.js
Modified: incubator/shindig/trunk/features/core.io/io.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/core.io/io.js?rev=659213&r1=659212&r2=659213&view=diff
==============================================================================
--- incubator/shindig/trunk/features/core.io/io.js (original)
+++ incubator/shindig/trunk/features/core.io/io.js Thu May 22 12:13:13 2008
@@ -131,42 +131,43 @@
approvalUrl: data.approvalUrl,
errors: []
};
- switch (params.CONTENT_TYPE) {
- case "JSON":
- case "FEED":
- resp.data = gadgets.json.parse(resp.text);
- if (!resp.data) {
- resp.errors.push("failed to parse JSON");
- resp.data = null;
- }
- break;
- case "DOM":
- var dom;
- if (window.ActiveXObject) {
- dom = new ActiveXObject("Microsoft.XMLDOM");
- dom.async = false;
- dom.validateOnParse = false;
- dom.resolveExternals = false;
- if (!dom.loadXML(resp.text)) {
- resp.errors.push("failed to parse XML");
- } else {
- resp.data = dom;
+ if (resp.text) {
+ switch (params.CONTENT_TYPE) {
+ case "JSON":
+ case "FEED":
+ resp.data = gadgets.json.parse(resp.text);
+ if (!resp.data) {
+ resp.errors.push("failed to parse JSON");
+ resp.data = null;
}
- } else {
- var parser = new DOMParser();
- dom = parser.parseFromString(resp.text, "text/xml");
- if ("parsererror" === dom.documentElement.nodeName) {
- resp.errors.push("failed to parse XML");
+ break;
+ case "DOM":
+ var dom;
+ if (window.ActiveXObject) {
+ dom = new ActiveXObject("Microsoft.XMLDOM");
+ dom.async = false;
+ dom.validateOnParse = false;
+ dom.resolveExternals = false;
+ if (!dom.loadXML(resp.text)) {
+ resp.errors.push("failed to parse XML");
+ } else {
+ resp.data = dom;
+ }
} else {
- resp.data = dom;
+ var parser = new DOMParser();
+ dom = parser.parseFromString(resp.text, "text/xml");
+ if ("parsererror" === dom.documentElement.nodeName) {
+ resp.errors.push("failed to parse XML");
+ } else {
+ resp.data = dom;
+ }
}
- }
- break;
- default:
- resp.data = resp.text;
- break;
- }
-
+ break;
+ default:
+ resp.data = resp.text;
+ break;
+ }
+ }
return resp;
}