diff options
author | thlo <t.lohmar@gmx.de> | 2013-01-07 20:36:08 +0100 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-01-07 20:36:08 +0100 |
commit | 21f592bf3c2f09f41cbc3c9c6a34ffe5d70df834 (patch) | |
tree | 9cd6850d40351dff9e830ee926781c0a5f28ccea /vdr-smarttvweb/web/Server.js | |
parent | b90278ae3caf9f7d2424e3b220b8fbf3cbeb0625 (diff) | |
download | vdr-plugin-smarttvweb-21f592bf3c2f09f41cbc3c9c6a34ffe5d70df834.tar.gz vdr-plugin-smarttvweb-21f592bf3c2f09f41cbc3c9c6a34ffe5d70df834.tar.bz2 |
Various fixes.
Diffstat (limited to 'vdr-smarttvweb/web/Server.js')
-rwxr-xr-x | vdr-smarttvweb/web/Server.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vdr-smarttvweb/web/Server.js b/vdr-smarttvweb/web/Server.js index 9fb39c5..14385df 100755 --- a/vdr-smarttvweb/web/Server.js +++ b/vdr-smarttvweb/web/Server.js @@ -32,7 +32,7 @@ Server.fetchVideoList = function(url) { if (this.XHRObj) {
this.XHRObj.onreadystatechange = function()
{
- var splashElement = document.getElementById("splashStatus");
+ // var splashElement = document.getElementById("splashStatus");
if (Server.XHRObj.readyState == 4) {
Server.createVideoList();
@@ -53,14 +53,14 @@ Server.fetchVideoList = function(url) { Server.createVideoList = function() {
console.log ("creating Video list now");
-
+ console.log ("status= " + this.XHRObj.status);
+
if (this.XHRObj.status != 200) {
- if (this.errorCallback != null) {
- this.errorCallback("ServerError");
+ if (this.errorCallback != null) {
+ this.errorCallback(this.XHRObj.responseText);
}
}
- else
- {
+ else {
var xmlResponse = this.XHRObj.responseXML;
if (xmlResponse == null) {
if (this.errorCallback != null) {
@@ -79,7 +79,8 @@ Server.createVideoList = function() { var items = xmlElement.getElementsByTagName("item");
if (items.length == 0) {
console.log("Something wrong. Response does not contain any item");
- };
+ this.errorCallback("Empty Response");
+ };
for (var index = 0; index < items.length; index++) {
@@ -94,6 +95,7 @@ Server.createVideoList = function() { durVal = parseInt(items[index].getElementsByTagName("duration")[0].firstChild.data);
}
catch (e) {
+ this.errorCallback("XML Parsing Error: " + e);
console.log("ERROR: "+e);
}
|