When using the window.open method in a function, it seems to work at the beginning of the code but not at the end. Here is an example where it works:
render = function() {
window.open("https://xxxx=singhi");
var yhttp = new XMLHttpRequest();
yhttp.open('GET', 'url', false);
yhttp.setRequestHeader('Authorization', 'AR-JWT ' + res);
yhttp.setRequestHeader('Content-Type', 'application/json');
yhttp.send();
const tit = yhttp.responseText;
document.write(tit);
document.write(tit.entries[0].values["Remedy Login ID"]);
remedyid=tit.entries[0].values["Remedy Login ID"];
};
However, in this other scenario, the window.open method does not seem to work as expected:
render = function() {
var yhttp = new XMLHttpRequest();
yhttp.open('GET', 'url', false);
yhttp.setRequestHeader('Authorization', 'AR-JWT ' + res);
yhttp.setRequestHeader('Content-Type', 'application/json');
yhttp.send();
const tit=yhttp.responseText;
document.write(tit);
remedyid = tit.entries[0].values["Remedy Login ID"];
window.open("https://xxxx=singhi");
};