They are quite some Javascript functions, I discovered that quite a few beginners may really in need of or might need a better understanding of the functionality and how they interact with the browsers.
Firstly, we will be looking into Alert. Hmmmm, not like credit alerts 🙂, so you don't have to get your hopes up so high.😄
• What is alert ?
Basically alert makes use of a modal to display messages to the users (visitors of the website) in the browsers.
Let's take a look at the code below,
• What is Prompt ?
Prompts enables the owner of the website to ask users/ visitors question(s) before they proceed to using the website.
Eg.
• What is confirm ?
Confirm looks like prompts in terms of the syntax but with the exception that it does not give an optional reply.
Disadvantages of making use of this Javascript interaction functions.
• The browser displays it's where it wants it to be displayed. Mostly it's in the top center of the webpage.
• You can't format like increase the width, add color to the modal etc.
• You must opt out by clicking ok, cancel or ESC key before you continue using the webpage.
Aaya, this are all I can come up with for now, please kindly write under the comment section of they is anything you may wish to add to it or any corrections to the article. This would so mean mean alot to someone out there.
Thank you for reading!
Top comments (4)
The problem with browser's modal is they are not accessible and can be bypassed opting out nags.
The better choice is always using a js design framework for drawing modals
Yeah, like popper.js framework
Is confirm will give a modal like prompt to user ?? I'm curious to know
Confirm does a modal with yes / no buttons