Is there any event sent to window when new tab opens from parent tab on click a anchor tag with target _blank?

Posted by Justin John on Stack Overflow See other posts from Stack Overflow or by Justin John
Published on 2012-12-05T09:30:12Z Indexed on 2012/12/06 5:04 UTC
Read the original article Hit count: 89

Filed under:
|

I need to write callback function on clicking an anchor with target="_blank".

<a rel="external" href="http://twitter.com/" target="_blank">
    <img src="twitter.png">
</a>

I think, following code block will do it.

$("a[target='_blank']").click(function() {
    // action required 
 });

Is there any other way where we can get an event with new tab opens?

For example: The unload event is sent to the window element when the user navigates away from the page. If I think same perspective, Is there any event sent to window when a new tab opens.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery