Content not showing in safari

I’m just getting into JS and have come across a few problems when using safari on both my PC and MAC. When using other browsers (firefox, IE8) there are no problems.

Is this just a safari problem you can’t get around yet?


<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var name=prompt("Please enter your name","Harry Potter");
if (name!=null && name!="")
  {
  document.write("Hello " + name + "! How are you today?");
  }
}
</script>
</head>
<body>

<input type="button" onclick="show_prompt()" value="Show prompt box" />

</body>
</html>