javascript welcoming msgbox problem

Posted by shouq on Stack Overflow See other posts from Stack Overflow or by shouq
Published on 2010-05-10T18:43:01Z Indexed on 2010/05/10 18:54 UTC
Read the original article Hit count: 177

Filed under:
|
|

hey... i'm doing my html and javascript class project

and i want to have a msgbox welcoming the visitor asking for his name and then a welcoming msgbox shows up saying "hello (the name added)"

i know how to do that but my only problem is that if i pressed back and went to the homepage of my website again, the msg will show up again asking for my name

is there anyway to prevent this from happening? seriously don't want the visitor to wite his name each time he goes to the home page

please help

this is the code i'm using:

     <script> 
response = window.prompt("Welcome!","Please enter your name");


window.alert("hello " + response);




</script>

please help

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about message