I am wondering if anyone knows how to, or can give me an example of a while loop that I can use for a website.
Looking online, I can;t seem to find any useful while loops that can be implemented into my website. I can't seem to think of any logical ones either apart from this one:
What I'm trying to do is when someone comes onto my website, I want them to be prompted using window.alert stating "Are you sure you want to enter this website? Please enter "Yes" to enter or "No" to leave the page. if they choose yes it will go to my Home.html page and if they choose "No" it will either return them to their homepage or to Google.
Does anyone know how to do this? I know it isn't the best While loop out there, but really it's just for show for a project. Please help if you can.
Note: It has to be a While loop. I do know how while loops work I'm just really having trouble implementing one to a website.