javascript ok cancel pop-up button -


i've tried lot of things, still can access .js file inside form: please, can tell me how can done?

this trying call:

 <script type="text/javascript">     if (confirm("press 'ok' leave, or 'cancel' if want stay: "))     {                 window.location="http://google.com";     }     else     {                <a href="javascript:history.go(-1)">go back</a>      }   </script> 

this how i've been trying call:

<input type="button" value="back main page" onclick= ??? > 

thank you.

var answer = confirm ("press ok leave. cancel stay.")    if (answer) window.location="http://google.com"    else window.location="http://www.mysite.com/" 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -