What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-14 17:15:21
window onload javascript
//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-11-11 01:53:15
var notification = new Notification
// request permission on page load document.addEventListener('DOMContentLoaded', function() { if (!Notification) { alert('Desktop notifications not available in your browser. Try Chromium.'); return; } if (Notification.permission !== 'granted') ... Add solution -
Javascript 2021-11-10 02:26:07
window onload
//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-29 02:00:09
pdfjs add custom event handler to viewer.js
<script> // add this script block to viewer.html (pdfjs/web/viewer.html) document.addEventListener('DOMContentLoaded', function() { console.log('DOMContentLoaded'); }, true); document.addEventListener('webviewerloaded', function(e) { ... Add solution -
Javascript 2021-10-27 00:29:16
multiple ckeditor on same page
/*HTML CODE*/ /* <script src="https://cdn.ckeditor.com/ckeditor5/18.0.0/classic/ckeditor.js"></script> <p><textarea placeholder="Description" id="body1" name="body"></textarea><... Add solution -
Javascript 2021-10-25 19:52:05
check if document is ready js
if( document.readyState !== 'loading' ) { console.log( 'document is already ready, just execute code here' ); myInitCode(); } else { document.addEventListener('DOMContentLoaded', function () { console.log( 'document was not ready, plac... Add solution -
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