Debugging Using alert() Methods 'html' : Debug : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Debug »

 

Debugging Using alert() Methods 'html'




<html>
<body>
<script language="JavaScript">
var myVariable;
var yourVariable;
   
function setType()
{
  alert("Inside the setType function.");  //Debug statement
  return(yourVariable="truck");
}
   
function setColor()
{
  alert("Inside the setColor function.");  //Debug statement
  return(myVariable="blue");
}
   
//Debug statement
alert("Before if statement: type="+yourVariable+" color="+myVariable);
   
if(setType() || setColor())
{
  //Debug statement
  alert("After if statement: type="+yourVariable+" color="+myVariable);
  document.write("The " + yourVariable + " is " + myVariable);
}
else
  alert("The vehicles could not be set");
   
</script>
   
</body>
</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Debug