How to add a responsive loader in website if loader is loaded then our website execute and not loaded it go on error page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to add a responsive loader in website if loader is loaded then our website execute and not loaded it go on error page

Responsive loader, if it loaded then our website comes, if it not loaded it show like Google dregon page or error page

28th Jul 2020, 12:34 PM
Mukesh tak
Mukesh tak - avatar
3 Answers
+ 3
The browser allows us to track the loading of external resources – scripts, iframes, pictures and so on. Use can use JavaScript to create loader for your website. Basically there are two events for it: onload – successful load & onerror – an error occurred. Loading a script Let’s say we need to load a third-party script and call a function that resides there. We can load it dynamically, like this: ``` let script = document.createElement('script'); script.src = "my.js"; document.head.append(script); ``` …But how to run the function that is declared inside that script? We need to wait until the script loads, and only then we can call it. Fof further detail visit: https://javascript.info/onload-onerror
3rd Aug 2020, 3:49 AM
Bits!
+ 2
It very helpful and I got my, so thank you very much 🙂
3rd Aug 2020, 4:22 AM
Mukesh tak
Mukesh tak - avatar
+ 2
Mukesh tak its my pleasure BRO 😍🖐
3rd Aug 2020, 7:30 AM
Bits!