Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I go through each of the prompts, and when the last one is finished/closed, the whole page (and in some instances 'browser') freezes. I can't reload the page. Any idea why this might be?

JavaScript
<!DOCTYPE HTML>
<meta charset="UTF-8">
<html>
<head>
<script type="text/javascript" defer>
function delivery(){
var custName1 = prompt('What name will the order be under?');
var custAddress1 = prompt ('What address should we deliver the order to?');
var custNumber1 = prompt ('Please enter your phone number (land-line) in case we need to contact you');
while(custNumber1 > 8600000 || custNumber1 < 9999999);
	{var custNumber1 = prompt('Please enter a valid phone number. (8600000-9999999)');
}
if(custNumber1 <= 8600000 || custNumber1 >= 9999999);
	{alert('Is this information correct?\nCustomer Name: '+custName1+'\nCustomer Address: '+custAddress1+'/nCustomer (land-line) number: '+custNum1+'' );
}
}
</script>
<title>Pete's Pizza</title>
</head>
<body bgcolor="#66FFCC">
<div id="main"><center><h1>Pete's Pizza</h1>
<h2>"The best pizza in Gisborne!"</h2><br>
<h2><font color="red">◄</font> Pete's Pizza Menu <font color="red">►</font></h2>
<br>
<h3>Standard Pizzas (Hawaiian, Cheese, Veggie, Supreme, Pepperoni) - cost: <font color="red">$9:50</font></h3>
<h3>Gourmet Pizzas (Meat-lovers, Chicken, Prawn) - Cost: <font color="red">$15.50</font></h3>
<br><br>
<hr width="1200px" color="#003300">
<br>
<h2><font color="#003300">◄ </font>Is this order for 'Pickup' or 'Delivery'?<font color="#003300"> ►</font></h2><br>
<input type=button value="Delivery" onclick="delivery()" id="delivery"> <input type=button value="Pickup" onclick="pickup()" id="pickup">
</center>
</div>
</body>
</html>


I've tried debugging, I couldn't find anything...

I started this thread on a reddit post I made this morning. But in reddit, you can't exactly bump posts, so I moved it here.
Posted

1 solution

Incorrect syntax, after the while and if statements, I put
';'. I thought that FireBug would pick up on the errors :o No matter.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900