Is there any event sent to window when new tab opens from parent tab on click a anchor tag with target _blank?
- by Justin John
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.