title: Adding speedbumps to some page links with javascript, confirm doesn't redirect
body: <p>I'm developing a site in vs2012, using ASP and VB backend, CSS and JavaScript.  Long story short, if a link takes the user off our site, it needs to have one of those disclaimer speedbumps saying we're not responsible blah blah.  I do this with the following code...</p>
  
  <pre><code>$(document).ready(function () {
      var anchors = $("a").get();
      for (var i = 0; i &lt; anchors.length; i++) {
          var anchor_element = anchors[i];
          var url = anchor_element.attributes[0].nodeValue;
          if ((url.indexOf('.com') != -1) || (url.indexOf('ForwardProcessing') != -1)) {
              anchor_element.onclick = function () {
                  return window.confirm('The link you selected will take you to a third party website...\r\rClick &lt;CANCEL&gt; if you would like to stay.');
              }
          }
      }
  });
  </code></pre>
  
  <p>So this accurately finds the links I'm looking for, and attaches the speed bump just fine (only in IE, but I'll explain more on that in a minute).  But at run time, then, when you click ok, I get the mouse pointer turning into a hand with an exclamation point, and the page doesn't change.  Obviously there is some error occurring in the JavaScript, but I can't find any good place in the code to put a break point to see what error might be happening.</p>
  
  <p>Which leads to the second problem... this only seems to work in IE.  I tried using firefox/firebug to look at the js, and the speedbump never occurs, the user goes straight on to the next page... which tells me there's <em>definitely</em> something wrong, but even less information.  Any JavaScript experts out there see anything?  I'm still pretty new to js, and after googling it for a day, haven't found anything...</p>
  
  <p>UPDATE:  The issue seems to be pop up related?  In the html, I use target = _blank to open the link in a new tab... taking this out resolves the issue, but I'd like to use the new tab... is there a conflict in this?</p>