window.open在函数开始时工作,但在函数结束时不工作



window.open在函数开始时工作,但在函数结束时不工作

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"]; 
};

这个不是

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");
};

刚刚从下面删除了false,之前出于某种原因我让它同步,但现在我需要它是异步的yhttp.open('GET','url',false(;

最新更新