commit 3dd7b98c0295bdf99b1ac0c5b652dcecd76969f2
parent 4c3120e5adceced3c52e6ec14f5c0a56884fcbff
Author: Sheng <webmaster0115@gmail.com>
Date: Thu, 23 Aug 2018 18:15:10 +0800
Defined a method onerror on reader
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js
@@ -213,7 +213,7 @@ jQuery(function($){
sock.onmessage = function(msg) {
var reader = new window.FileReader();
- reader.onloadend = function(){
+ reader.onload = function(){
var text = decoder.decode(reader.result);
// console.log(text);
if (term) {
@@ -225,11 +225,15 @@ jQuery(function($){
}
};
+ reader.onerror = function(e) {
+ console.error(e);
+ };
+
reader.readAsArrayBuffer(msg.data);
};
sock.onerror = function(e) {
- console.log(e);
+ console.error(e);
};
sock.onclose = function(e) {