Fixed codacy issue.

This commit is contained in:
DL6ER
2016-11-18 13:56:13 +01:00
parent d33d53792e
commit f777ba6735
+8 -8
View File
@@ -1,28 +1,28 @@
function eventsourcetest() {
var alInfo = $("#alInfo");
var alSuccess = $("#alSuccess");
var ta = document.getElementById('output');
var source = new EventSource('php/gravity.sh.php');
var ta = document.getElementById("output");
var source = new EventSource("php/gravity.sh.php");
alInfo.show();
alInfo.hide();
alSuccess.hide();
source.addEventListener('message', function(e) {
if(e.data == "START"){
source.addEventListener("message", function(e) {
if(e.data === "START"){
alInfo.show();
}
else if(e.data == "SUCCESS"){
else if(e.data === "SUCCESS"){
alSuccess.show();
alInfo.delay(1000).fadeOut(2000, function() { alInfo.hide(); });
}
else if (e.data !== '')
else if (e.data !== "")
{
ta.innerHTML += e.data;
}
}, false);
// Will be called when script has finished
source.addEventListener('error', function(e) {
source.addEventListener("error", function(e) {
source.close();
}, false);
}