0

I have recently noticed the when you set a link or form target to _blank and click/submit it, it opens in a new tab on all major browsers but when I use javascript/jquery to either click/submit the link/form, it opens it as a popup window instead of a tab, this behaviour is only in Chrome, Firefox and IE <= 8, not in IE 9+

So clicking on this link or submit button works for a new tab:

<a href='http://google.com' id='myLink' target='_blank'>
<form action='http://google.com' id='myForm' target='_blank'>
<input type='submit' value='go' />
</form>

But when doing this it opens as a popup so most browsers block it:

$('#myLink').click();
$('#myForm').submit();

Anyone know any workarounds for this or some better solution?

EDIT: I'm trying to avoid any window.open() methods.

Stuyvenstein
  • 2,340
  • 1
  • 27
  • 33

0 Answers0