I am learning javascript with help of tutorials and have typed this simple code.
When I run the page in Chrome, IE, and Firefox the window.prompt works as should. The rest of the code fails. It should alert me either of the two alerts depending if the user enter a name, but it does nothing nor does it do the document.write. Any suggestions or answers would be greatly appreciated.
Code:
<html>
<body>
<title>Windows and Window Properties</title>
<script language ="javascript">
Response ="";
while((Response=="")||(Response =="<undefined>")){
Response=window.prompt("Please Enter your Name");
}
if(response == "undefined")
{
window.alert("Hello, Welcome to our page!");
}
else
{
window.alert("Hello, " + Response + "! Welcome to our page!");
}
document.write("<br> THis is the content of the window.html page: <br>")
</script>
</body>
</html>
Comment