Return boolean value from function : Function Return : Function JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Function » Function Return »

 

Return boolean value from function

















<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 Function
» Function Return