0

I'm trying to use window.open to open a URL in a new tab or window. At the moment I can only get it to open in a "pseudo-window" which ressembles more a pop-up than a proper window.

How can I use JavaScript to open URLs in a proper window or tab in Chrome?

Note: I've tried finding the code for the function window.open using the Code Search, but cannot find it.

Randomblue
  • 112,777
  • 145
  • 353
  • 547

3 Answers3

3

As far as I know, this is controlled by the browser and we don't have a way to change it.

You could use a hyperlink with the target set to "_blank" and try, but that wouldn't be window.open.

Some Guy
  • 15,854
  • 10
  • 58
  • 67
0

Open a URL in a new tab (and not a new window) using JavaScript

taken from here

$('a').click(function() {
  $(this).attr('target', '_blank');
}); 
Community
  • 1
  • 1
ikassi
  • 98
  • 8
0
$(document).ready(function() {
   $('#NewTab').click(function() {
        $(this).target = "_blank";
        window.open($(this).prop('href'));
        return false;
   });
});​

It may help you

frangly
  • 162
  • 7