1860Views2Replies

Author Options:

Pop up html or Javascript that if OK is clicked it goes to one page but if no is clicked, goes to different page?? Answered

Disclaimer for a website im making.

Discussions

0
user
lemonie

Best Answer 8 years ago

Insert this script into the <HEAD>:

<script type="text/javascript">
function show_confirm()
{
var r=confirm("Click to continue");
if (r==true)
  {
  window.location="http://www.";
  }
else
  {
  window.location="http://www.";
  }
}
</script>

Insert this into the <BODY>

<input type="button" onclick="show_confirm()" value="Popup box" />

Values in bold you would change as you like/need

L


<script type="text/javascript">
<!--

var answer = confirm("SOME MESSAGE HERE")
if (answer)
window.location="URL OF SITE 1"
else
window.location="URL OF SITE 2"

// -->
</script>