0

How to open menu hyperlink in a new tab instead of new window?

In this case below is my code and its currently opening in new windows not same browser tab.

_bindEventsMain:function(){
  $('.menu-link').on('click', HomeJs._menuClick);
}    

_menuClick:function(e) {
    e.preventDefault();
    var href = $(this).attr('data-href');
    var t = $(this).attr('data-title');
    var popup = window.open(href,t, '_blank');
},

1 Answers1

2

Pass _blank in second argument.

var popup = window.open(href, '_blank');
Brijesh Bhatt
  • 3,810
  • 3
  • 18
  • 34