Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There might be an issue with popup blockers (I'm thinking Googlebar) stopping the window from opening, and (with the presence of <code>onclick</code>) preventing the <code>onclick</code> code from running. For example see <a href="http://www.webmasterworld.com/forum91/5508.htm" rel="nofollow noreferrer">this</a> and <a href="http://www.webmasterworld.com/forum80/24662.htm" rel="nofollow noreferrer">this</a> similar sounding issues other people are having.</p> <p>Or it might simply be that the click handler code is throwing an error that then prevents the rest of the code from completing. See my comment to your question re how you are binding the events. <code>e.stop()</code> may be failing in IE.</p> <p>Your hypothesis however is false. <code>target="_blank"</code> and <code>onclick="..."</code> do work together just fine.</p> <p>Testcase in point: <a href="http://jsbin.com/anahe" rel="nofollow noreferrer">http://jsbin.com/anahe</a> (add <code>/edit</code> to the url to edit the code). <em>You may need to turn off your popup blocker(s)</em>:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;title&gt;Sandbox&lt;/title&gt; &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt; &lt;script&gt;var clickCount= 0;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="http://www.google.com" target="_blank" onclick="document.getElementById('dbg').innerHTML = ++clickCount"&gt; open new &lt;/a&gt; &lt;div id="dbg"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Clicking on the link opens a new window <em>and</em> updates the div with the number of times the linked has been clicked. Tested this in IE6, IE7, FF2, FF3.5, Chrome 2, Chrome 3, Opera 9.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload