Use Javascript Confirm To Pause Scripts Pending User Input • Use Javascript Confirm To Pause Scrip...
With JavaScript confirm you can ask for input from your users before your script carries on running. This is most often done to force people to accept your terms of service before they can progress with the order process.
You can detect whether people chose Yes, No or closed the dialog box and then run different scripts depending on their input.
Below the example from the tutorial. Feel free to copy it into your project and use it as you wish.
var confirmMessage = confirm('Please press a button!');
if (confirmMessage == true) {
alert('You pressed OK!');
} else {
alert('You didn\'t press OK!');
}
That's all there is to it. I hope this video helps you! If you have any questions, please leave them in the comments below. And before you go, subscribe and like :)
If you're into Wordpress, check out my WPLearningLab channel to learn more about WordPress so you can earn more for yourself, for your clients or for your business.
На этой странице сайта вы можете посмотреть видео онлайн Use Javascript Confirm To Pause Scripts Pending User Input длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Full Stack Coding Tutorials 14 Апрель 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 301 раз и оно понравилось 5 зрителям. Приятного просмотра!