Hi,
I'm a newbie on javascript, and am experimenting with this simple script below.
I was wondering how could I halt/quite/close the script/program after pressing the X or CANCEL button?
I try to press X and CANCEL button, but it won't quit and this script results in infinite loop
<html><head><title>Phone Cost</title></head>
<body on>
<script>
var i
var minutes
var monthly
var excess
var charge
var total
while (minutes=1)
{
minutes = prompt("Minutes Used:");
alert("Your entery was: "+minutes+"");
monthly=40
excess=minutes-600
charge=excess*0.49
total=monthly+charge
if(minutes>=600)
{
document.write("Your Minutes Uses is: "+minutes+" <br>");
document.write("Excess Minutes Uses is: "+excess+" <br>");
document.write("Monthly Charges is: $"+monthly+".00<br>");
document.write("Excess Minutes Charge is: "+charge+" <br>");
document.write("Total Charge is: "+total+" <br><br><br>");
}
else
{
document.write("Your Minutes Uses is: "+minutes+" <br>");
document.write("Monthly Charges is: $"+monthly+".00<br><br><br>");
}
}
</script>
</body>
</html>
Pleaseee helppp...