How to avoid page being displayed in another tab

1

I have this jquery

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

And this button calls this page

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

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

    
asked by anonymous 07.05.2014 / 02:36

1 answer

1

I think you might be doing this:

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

Or

location.href = "/gerenciarpdv"

JSFiddle

I'm not a jQuery expert, so I think there might be more appropriate solutions.

07.05.2014 / 03:15