ahh, ok well It’s working for me using this native js snippet It opens in a new tab
function getUser(id) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4)
if (xhr.status == 200) {
goToView(id)
}
}
xhr.open('GET', `view.php?id=${id}`);
xhr.send();
}
function goToView(id) {
window.open(`view.php?id=${id}`, '_blank');
}
Thank you again
However, the browser is blocking
I want to bypass browser blocking but that is not possible I guess
It informs the visitor with the following code
I’ll try to deal with it for now
var win = window.open('http://stackoverflow.com/', '_blank');
if (win) {
//Browser has allowed it to be opened
win.focus();
} else {
//Browser has blocked it
alert('Please allow popups for this website');
}
I don’t know how to do this
When I click it manually there is no problem, the tab opens.
However, when ajax is successful, automatically opening tabs is blocking the browser.