1
我有這樣的問題。我需要打開彈出窗口按下按鈕(這個動作被執行)。然後彈出窗口將被加載它應該被關閉。加載後關閉彈出窗口
$(document).ready(function() {
$('#popupButton').click(function() {
signinWin = popupwindow([url],
"SignIn",960,630);
signinWin.focus();
signinWin.onload=function(){
var code = getQueryVariable("code");
if(code != null){
signinWin.opener.location.reload(true);
signinWin.close();
}
}
});
});
我該怎麼做才能關閉彈出窗口?原因signinWin.close();在onload事件
你不明白,功能popupwindow()打開新窗口。它使用window.open函數popupwindow(url,title,w,h)var left =(screen.width/2) - (w/2); \t var top =(screen.height/2) - (h/2); \t return window.open(url,title,'toolbar = no,location = no,directories = no,status = no,menubar = no,scrollbars = no,resizable = no,copyhistory = no,width ='+ w +' ,height ='+ h +',top ='+ top +',left ='+ left); '但是問題是我只需要在關閉窗口後才加載 –
謝謝。這一行幫助我關閉了彈出窗口:signinWin.document.write(「