So I have made some games in HTML5 which are played one after another, the game changes every 5 minutes using the loadgame function with the preloadJS library. gameID is the filename of the new game to load. What happens is that if the internet is very slow then no event is triggered and the next game is never loaded.
loadgame = function()
{
canvas = document.getElementById("canvas");
stage = new createjs.Stage(canvas);
loader = new createjs.LoadQueue(false);
loader.loadFile({src:gameID+".js", type:"javascript"}, true);
loader.addEventListener("complete", prehandleComplete);
loader.addEventListener("error", handleLoadError1);
loader.addEventListener("fileerror", handleLoadError1);
}