diff options
author | Alib <aliboba@free.fr> | 2010-02-27 18:27:53 +0100 |
---|---|---|
committer | Alib <aliboba@free.fr> | 2010-02-27 18:27:53 +0100 |
commit | 2429b586aeeb9d7eb7e77bdd932ce76e364bc8c5 (patch) | |
tree | cc0f580c7bce58923bf62cf03d8bd934566dce5f | |
parent | 3497a84b220e1419e3642faa763fb2b5965675b0 (diff) | |
download | istreamdev-2429b586aeeb9d7eb7e77bdd932ce76e364bc8c5.tar.gz istreamdev-2429b586aeeb9d7eb7e77bdd932ce76e364bc8c5.tar.bz2 |
new error handling
-rwxr-xr-x | javascript/ajax.js | 8 | ||||
-rwxr-xr-x | javascript/functions.js | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/javascript/ajax.js b/javascript/ajax.js index 98006e6..a5a1b14 100755 --- a/javascript/ajax.js +++ b/javascript/ajax.js @@ -16,11 +16,13 @@ function alert_ajax(xhr, session) { var docXML= xhr.responseXML; var streamstatus = null; - var items = docXML.getElementsByTagName("streamstatus") - + var items = docXML.getElementsByTagName("streamstatus"); streamstatus = items.item(0).firstChild.data; + var items2 = docXML.getElementsByTagName("message"); + errmessage = items2.item(0).firstChild.data; if ( streamstatus == 'error' ) - this.location.href = 'error.php'; + //this.location.href = 'error.php'; + errorMsg(errmessage); else swapPic(session); } diff --git a/javascript/functions.js b/javascript/functions.js index b713232..86811ff 100755 --- a/javascript/functions.js +++ b/javascript/functions.js @@ -206,3 +206,8 @@ function addplayer(path,name,track) { document.getElementById('div_player').innerHTML = playercode;
}
+function errorMsg(errmessage) {
+ htmlmsg="<span class='graytitle'>Error</span><ul class='pageitem'><li class='textbox'><span class='header'>Error</span><p><strong>" + errmessage + "</strong></li></ul>";
+ document.getElementById('content').innerHTML = htmlmsg;
+}
+
|