i have some code which can be found here on JS Fiddle
var getJSON = function (url) {
"use strict";
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('get', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
resolve(xhr.response);
} else {
reject(status);
}
};
xhr.send();
});
};
function updateCount() {
"use strict";
getJSON('http://192.99.124.166:8080/count').then(function(data) {
console.log('update');
stats.innerText = data.result; //display the result in an HTML element
});
}
updateCount();
setInterval(updateCount, 10000);
If you visit that Fiddle page on Chrome, Opera or Microsoft Edge you will see server/player stats auto updating every 10 seconds and working how it was intended. However if you visit on IE 11, or Firefox nothing displays in the div that is supposed to be loading the results.
I am not to good with Javascript and had some help with this code originally by someone through an IRC channel i did use JS Lint to check the code, and i updated it and fixed what they considered bad code by putting in "use strict" etc. However that did not resolve the issue on IE 11 or Firefox.
Any assistance will be greatly appreciate in figuring this out, i did use the inspector on IE 11 and Firefox and the debug console but nothing is firing or showing up. In fact, it even shows the (update) message in the browser console, but doesn't show the div!