title: jQuery window.open not working
body: <p>I have very simple code</p>
  
  <pre><code>$('.opennewwindow').click(function(e) {
      e.preventDefault();
      window.open("http://www.stackoverflow.com")
      /*alert('its works');*/
  });
  
  &lt;button class="opennewwindow" value="somevalue"&gt;Open new window!&lt;/button&gt;
  </code></pre>
  
  <p>Unfortunately, the code does not work (the function calls, but not open.window). Errors dont appear anywya.</p>
  
  <p>I tried like this too:</p>
  
  <pre><code>$('.opennewwindow').click(function(e) {
      e.preventDefault();
      myWin = window.open("http://www.stackoverflow.com");
      myWin.focus();
  });
  </code></pre>
  
  <p>and following error <code>TypeError: myWin is undefined</code>.</p>
  
  <p>I used a <code>$(document).ready()</code>etc. but same effect.</p>
  
  <p>The clue is that on my website I have a ajax scripts. This button and function is also loaded by ajax.</p>
  
  <p>Anyone know why this is not working?</p>