title: javascript window.open not working in safari and chrome
body: <p>I have a div element.
  The div is an icon.
  When you click on this icon is triggered a form submit.
  On the form submit there are some calculations and with the result of those calculations a new tab is opened. </p>
  
  <p>I use the "<strong>window.open(url, '_blank');</strong>"</p>
  
  <p>But in safari and chrome this new tab is seen as a popup and is blocked.</p>
  
  <p>I tried to create a hidden a href and to trigger click so it will open the page in new tab, but it doesn't work.</p>
  
  <p>Any idea how to fix this?</p>
  
  <p><strong>EDIT - SOLUTION FOUND</strong></p>
  
  <p>You need to add the window.open on a click event inside an $.ajax success method. In this way it will work.</p>
  
  <pre><code>$('#myButton').click(function () {
      var redirectWindow = window.open('http://google.com', '_blank');
      $.ajax({
          type: 'POST',
          url: '/echo/json/',
          success: function (data) {
              redirectWindow.location;
          }
      });
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/safeeronline/70kdacL4/1/" rel="noreferrer">http://jsfiddle.net/safeeronline/70kdacL4/1/</a></p>