What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-24 15:01:13
jQuery Dom ready equivalent in pure JavaScript
function docReady(fn) { // see if DOM is already available if (document.readyState === "complete" || document.readyState === "interactive") { // call on next available tick setTimeout(fn, 1); } else { ... Add solution -
Javascript 2021-10-17 22:50:04
js on page loaded
//two ways of executing JS code after page is loaded, use "DOMContentLoaded" when able document.addEventListener("DOMContentLoaded", function(){ //dom is fully loaded, but maybe waiting on images & css files }); window.... Add solution -
Javascript 2021-10-15 05:12:08
play background music in jasvascript
<audio src="https://www.bensound.com/bensound-music/bensound-moose.mp3"></audio> <Script> window.addEventListener("DOMContentLoaded", event => { const audio = document.querySelector("audio"); a... Add solution -
Html 2021-10-06 09:14:04
how to find total height of single page page in html
function calculateTotalHeightMinusElement(excludeElementClass) { // Get all child elements of the body tag var bodyChildren = (document.getElementsByTagName('body')[0]).children; var totalHeight = 0; // Loop through the selected elements for (... Add solution -
Javascript 2021-09-27 18:47:02
js document ready
//two ways of executing JS code after page is loaded, use "DOMContentLoaded" when able document.addEventListener("DOMContentLoaded", function(){ //dom is fully loaded, but maybe waiting on images & css files }); window.... Add solution -
Other 2021-09-16 07:09:03
detect livewire is loading in javascript
window.livewireLoading = false; document.addEventListener("DOMContentLoaded", () => { Livewire.hook('message.sent', (message, component) => { livewireLoading = true; }) Livewire.hook('message.processed', (message, com... Add solution