How can I create this thing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I create this thing

It’s very common to have "Preloader" component, especially in multifunctional apps and websites. Create a function that will output "Loading" to the console. Output Loading

10th Sep 2021, 3:33 AM
Jamilu Abubakar Sadiq
Jamilu Abubakar Sadiq - avatar
1 Answer
+ 1
you should write A function in javascript that will run if the page is not fully loaded you can use ` document.readyState` it will return 'loading' if the page is not fully loaded , otherwise it will return 'complete' so here is an example: // this will run if the page is not fully loaded if(document.readyState =='loading'){ document.body.innerText='loading'; }
10th Sep 2021, 4:55 AM
Nima