Created
October 13, 2017 04:35
-
-
Save fuzzy/e11dc182dcab3f01014b38aa0ee438b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Events worker | |
*/ | |
var salt_events; | |
function startEventsWorker() { | |
if (typeof(Worker) !== "undefined") { | |
if (typeof(salt_events) == "undefined") { | |
salt_events = new Worker("/goat/events.js"); | |
} | |
salt_events.onmessage = function(event) { | |
$("#salt_event_output").html = event.data; | |
}; | |
} else { | |
document.getElementById("salt_event_output").innerHTML = "Sorry, your browser does not support web workers."; | |
} | |
} | |
function stopEventWorker() { | |
salt_events.terminate(); | |
salt_events = undefined; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment