等待弹出窗口javascript

abi*_*rto 1 javascript alert window wait

基本上我是这样做的:

 window.onload=function wait(){
     alert ("Please, wait until process has finished.");
     window.location="index.jsp";
 };
Run Code Online (Sandbox Code Playgroud)

我需要的是一个警报窗口或类似的东西,它会消失/启用弹出窗口中的“确定”按钮,只有在 X 秒过去后。

我怎样才能做到这一点?

Tee*_*emu 5

也许你需要这样的东西:

window.onload = function () {
    var popup = window.open('','pop','width=200px, height=10px'),
        popdoc, msg, script;
    if (popup) {
        popdoc = popup.document;
        msg = popdoc.body.appendChild(popdoc.createElement('p'));
        msg.innerHTML = 'Please, wait until process has finished.';
        script = popdoc.createElement('script');
        script.text = '(function () {setTimeout(function () {self.close();}, 3000);}());';
        popdoc.body.appendChild(script);
    }
}
Run Code Online (Sandbox Code Playgroud)

jsFiddle的演示