Broucheek
02-12-2008, 08:52 AM
Hello there,
I wrote the following code. However it doesnt work. Can anyone tell me why. If i delete the first second expression and leave just the one it works. It seems that something in the 2 expressions is incorrect but i have no idea what.
Thank you
Code is;
<HEAD>
<TITLE>
While loop
</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
var pass;
pass = window.prompt('Please enter your password', ' ');
while ((pass != 'truck') || (pass != 'orange'))
{
pass = window.prompt('Please enter either orange or truck', ' ');
};
document.write('thank you');
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
I wrote the following code. However it doesnt work. Can anyone tell me why. If i delete the first second expression and leave just the one it works. It seems that something in the 2 expressions is incorrect but i have no idea what.
Thank you
Code is;
<HEAD>
<TITLE>
While loop
</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
var pass;
pass = window.prompt('Please enter your password', ' ');
while ((pass != 'truck') || (pass != 'orange'))
{
pass = window.prompt('Please enter either orange or truck', ' ');
};
document.write('thank you');
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>