title: Jquery dirtyforms not working properly on DIV click and window.location.href
body: <p>I have used jquery.dirtyforms with bootstrap modal to notify user that something is not saved in this page. This worked perfectly with anchor links but I have a <code>div</code> on the page which is actually working as a link to some other page. This <code>div</code> has <code>data-action</code> attribute containing the URL of the other page and on click I am setting the <code>data-action</code> value to <code>window.location.href</code> to navigate. When I click the <code>div</code> it gave the confirmation message on default popup of browser instead of Bootstrap Modal. I have given a unique class to the div named <code>tabDiv</code>. I tried to add the support for div in jquery.dirtyforms.js and written this which did not work:</p>
  
  <pre><code>&lt;div class="sf-active div_Header tabDiv" id="div_Header" data-action="@Url.Action("ViewContract", "Contract", new { Id = Request.QueryString["Id"] })"&gt;
      &lt;span&gt;First&lt;/span&gt;
      &lt;i class="i_Header"&gt;&lt;/i&gt;
      ClickMe
      &lt;div class="ContraHeader glyphicon"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$(".div_Header").click(function(evt) {  
      evt.stopImmediatePropagation();
      var url = $(this).attr('data-action');
      if (url !== undefined)
          window.location.href = url;
  });
  </code></pre>
  
  <p>What I tried to change in Jquery.DirtyForms.Js which does not work</p>
  
  <pre><code>var events = {
      bind: function (window, document, data) {
          $(window).bind('beforeunload', data, events.onBeforeUnload);
          $(document)
              .on('click', 'a:not([target="_blank"])', data, events.onAnchorClick)
              .on('submit', 'form', data, events.onSubmit)
              .on('click', 'div.tabDiv', data, events.onDivCLick);
      }, onDivCLick: function(ev){
          bindFn(ev);
      },
  </code></pre>
  
  <p>I want it to work on <code>div</code> click also. Presently it is working but the message on browser's default popup. I want to show the same Bootstrap Modal on this click also.</p>