I have a function on the server that returns a URL.
I need to open this URL in a new tab, if the tab is already open, I need to set focus on the tab.
The first time I call the method it works well, but if the tab is already open, it only refreshes the page without the focus.
If I move the win.focus() outside the ajax it works on Chrome, but not in Firefox.
$.ajax({
url: myurl,
dataType: 'text',
data: { "id" : $('#selectOrder').val()}
success: function (data) {
var win = window.open(data, 'mytab');
win.focus();
}
});