The only problem is using document.write. If you use innerHTML instead, you'll be singing.
<a href="#blah" onClick="firstName(); return false;">Click</a>
Put that div where ever you want the name to appear, and it is also where the page will jump to. Change the id (blah) to something else if you want to change that behaviour.
var name = prompt ("Please Enter Your Name");
document.getElementById("[COLOR="Red"][B]blah[/B][/COLOR]").innerHTML = name;
And a quick note, a link with "#blah" as the href doesn't actually reload the page, just jumps down along it.