jquery - customized javascript confirmation box -


enter image description herei have customized confirmation box....when press logout box displayed...if cancel pressed box closed control remains in same page...when yes pressed ,logout has take place....for me,cancel working fine...but when user presses yes, there no response....could me...thanks in advance...

my code:

<s:a href="logout" cssclass="plantabheader" id="logoutid"> <img src="../../ky/images/common/header/lock.png" alt="logout" style="border: none;background-color: transparent;" /> &nbsp;log out</s:a> 

javascript:

<script type = "text/javascript" >  $(document).ready(function () {     $($('#logoutid')).click(function (event) {           var msg = "";         var buttons = {};         msg = "are sure want logout?";          buttons["yes"] = dologout;          buttons["cancel"] = closedialog;         if (msg != "") {              showdialog(buttons, "cancelconfirm", msg, "dialognormal",                 "confirmation", 470);          }         return false;     }); });  function dologout() {     document.getelementbyid("logoutid").href = "logout"; }  function closedialog() {     /* alert("action closedialog"); */     $("#cancelconfirm").dialog("close");     $("#cancelconfirm").dialog("destroy"); }  </script> 

expanding on comment above maybe function should

   function dologout() { window.location = "/logout"; // not sure on url structure   } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -