How to avoid page being displayed in another tab

Asked

Viewed 228 times

1

I have this jquery

$(window.document.location).attr('href', '/gerenciarpdv');

And that button calls that page

<button id="teste1" name="teste" class="btn-pesquisa" onclick="ChamaGerencia();">GerenciarPDV</button>

The problem is that the page is being displayed in another tab. How to avoid this?

  • To avoid, or force the page to open in another window?

1 answer

1

I think you might be doing it this way:

window.open("/gerenciarpdv","_self")

Or

location.href = "/gerenciarpdv"

Jsfiddle

I’m not familiar with jQuery, so I believe there can be more appropriate solutions.

  • Ok, but in another form I do the same way that posted and works, IE, does not open in another tab.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.