Use Confirm dialog in if statement : confirm : Dialogs JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Dialogs » confirm »

 

Use Confirm dialog in if statement

















<html>
<head>
<script Language="Javascript" type = "text/javascript">
<!--
var newurl

function CheckRequest(newurl)
{
    if (confirm("Do you want to visit " + newurl + " site.")) {
      return true
    else {
      return false
    }
}

//-->
</script>
<title>Capturing Links</title>
</head>
 <P><A href="http://www.navioo.com" onClick = "return CheckRequest('java2s')">Java</A></P>
 <P><A href="http://www.netscape.com" onClick = "return CheckRequest('Netscape')">Netscape</A></P>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Dialogs
» confirm