Hi,
I'm trying to learn Javascript using the WS3 tutorials. I run the following simple example and it works fine in all browsers except Firefox. The example renders a button that, when clicked, renders a dialog to prompt you for text input.
In Firefox, it appears that after completing the example process, the code never finishes loading loading the page, and the page load icon (in the page tab at the top) just continues to spin.
Any thoughts on why and how to fix it? Again, it works fin in Chrome and Safari.
Code:
<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var name=prompt("Please enter your name","Harry Potter");
if (name!=null && name!="")
{
document.write("<p>Hello " + name + "! How are you today?</p><br/>");
document.write("<p>Today's Date is: " + Date() + "</p>");
}
}
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="Press This Button To Show The Prompt Dialog Box" />
</body>
</html>
Thanks for any help you can offer,
Frank