Countdown, Webworker
How do I make an countdown, webworker?
Simple webworker, coundown/countup.. What is a countdown, webworker? How do you make a countdown, webworker? This script and codes were developed by Oliver Schafeld on 05 October 2022, Wednesday.
Countdown, Webworker - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Countdown, Webworker</title>
</head>
<body> <div id="counter"> -</div>
<script id="myWorker"> var i = 5; setInterval(function() { i--; postMessage(i); }, 1000);
</script>
<div id="message">counting down...</div> <script src="js/index.js"></script>
</body>
</html>
Countdown, Webworker - Script Codes JS Codes
var setMessage = function(msg) { var msgDiv = document.getElementById('message'); msgDiv.innerHTML = msg; }
var myWorker = null, URL = window.URL || (window.webkitURL);
window.URL = URL;
var workerData = new Blob([document.getElementById('myWorker').textContent], { type: "text/javascript"
});
function init() { if (typeof (Worker) === undefined) { alert('No webworker supported'); return false; } myWorker = new Worker(window.URL.createObjectURL(workerData)); myWorker.onmessage = function (e) { document.getElementById('counter').innerHTML = e.data; if (e.data === 0) { setMessage("LIFT OFF!"); } if (e.data === -4) { setMessage("Tower has been cleared... "); } if (e.data === -10) { setMessage("Whoooohoo, magic carpet ride! "); } };
}
init();
Developer | Oliver Schafeld |
Username | schafeld |
Uploaded | October 05, 2022 |
Rating | 3 |
Size | 1,839 Kb |
Views | 26,312 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Responsive Image through CSS | 2,240 Kb |
Simulating an Inputfield with Canvas | 1,894 Kb |
Disable copy and paste | 1,564 Kb |
2-column, Flex-box menu fly-out | 2,103 Kb |
Input Button Plus Minus | 2,073 Kb |
RWD Boilerplate | 3,356 Kb |
3D Dose | 3,250 Kb |
Qooxdoo ToDo | 2,913 Kb |
Qooxdoo Button Menu | 2,076 Kb |
Button Download Flyer rtk-russia.de | 2,252 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Web Spiral - p5.js | TWAIN | 2,183 Kb |
Search Box in Content Moves to Fixed Header | Chriscoyier | 2,768 Kb |
JavaScript Animation | Rcmeisty | 4,581 Kb |
Board Site | IndianaLuft | 10,542 Kb |
Responsive Table-less Shopping Cart | Alex_rodrigues | 6,637 Kb |
Basic HTML Slideshow | Tomhodgins | 3,386 Kb |
A Pen by Matt Popovich | Mpopv | 3,349 Kb |
Sexy Social Buttons | Ipiyale | 2,226 Kb |
Weird glowy CSS3 game | Toneworm | 3,684 Kb |
Michelle, submit your photography to Unsplash. | Zaneriley | 3,368 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!