title: Overriding javascript confirm with jquery
body: <p>I want to override javascript confirm with jQuery dialog box. Here is my overridin code: <br ></p>
  
  <pre><code>window.confirm = function(message, caption = 'Confirmation'){
      $(document.createElement('div')).attr({title: caption, 'class': 'dialog'}).html(message).dialog({
          position:['center',100],
          dialogClass: 'fixed',
          buttons: {
              "OK": function(){
                  $(this).dialog('close');
                  return true;
              },
              "Cancel": function(){
                  $(this).dialog('close');
                  return false;
              }
          },
          close: function(){
              $(this).remove();
          },
          draggable: false,
          modal: true,
          resizable: false,
          width: 'auto'
      });
  };
  </code></pre>
  
  <p>And here is my action code:</p>
  
  <pre><code>if(confirm('Are you sure?') == false) { return false; }
  </code></pre>
  
  <p>This code does not work. How can I do this?</p>