0

I need help with this logout link i made

When you click it, it should show a confirm box, but it doesn't.

Heres the Javacript

<script language='javascript'>
function confirm(){
var f = confirm("Are You Sure You Want To Logout?");
if(f){
return true;
}
else{
return false;
}
}
</script>

And heres the link

<a href='logout.php' onClick='return confirm()'>logout</a>

Plz help??

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by DealthRune
0

Hi DealthRune,

you could try this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Free Live Help!</title>
<script type="text/javascript">
<!--
var _confirm = function() {

   if ( confirm("Are You Sure You Want To Logout?"))
     location.replace("logout.php");
  
};
// JavaScript-1.5 -->
</script>
</head>
<body id="body">
<div id="div">
<a href="#" onclick="_confirm();">Logout</a>
</div>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.