dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web
Expertise: Beginner
Aug 6, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Displaying User Confirmation Dialogs

In JavaScript, it is easy to ask the user to confirm an action by using JavaScript Confirm () function. Say you have a function NavigateToWebAddress() (which needs confirmation from the user before performing the action, such as navigating to a particular site), then you can just call Javascript native function confirm() from within their function.

 
<script language=JavaScript >
function NavigateToWebAddress() {
   if (confirm("Are you sure you want to go to the webpage?")) {
      location = "www.MyWebPage.com"
   }
}
</script>
 
Jai Bardhan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date