팝업 창은 사용자가 별도의 창에서 문서 페이지를 열 수 있도록하기 위해 사용됩니다. 사용자가 다음 문서 페이지를 열려고하면 모든 이전 문서 페이지 창이 닫혀 야합니다.자바 스크립트를 사용하여 여러 팝업 창 닫기
기본적으로 여러 개의 팝업 창이 닫힙니다. 열린 팝업 윈도우의 레퍼런스를 저장하기 위해 변수에 팝업 윈도우 레퍼런스를 포함하는 배열을 저장했습니다. 그리고 변수의 값은 숨겨진 필드에 저장됩니다.
이제 popup = window.open('', '', sOptions);
은 [object]
을 반환하고이 [object]
을 검색하면 개체가이 속성이나 메서드를 지원하지 않는다는 오류가 발생합니다. 내가 잘못 뭐하는 거지
var popupWin = new Array();
function OnPopupClick(url,title,name) {
var popup = null;
var sOptions;
sOptions = 'status=yes,menubar=no,scrollbars=yes,resizable=yes,toolbar=no,titlebar=yes,location=0,directories=0';
sOptions = sOptions + ',width=' + (screen.availWidth - screen.availWidth/2).toString();
sOptions = sOptions + ',height=' + (screen.availHeight - 50).toString();
sOptions = sOptions + ',screenX=0,screenY=0'
sOptions = sOptions + ',left=' + ((screen.availWidth/2) - 10).toString();
sOptions = sOptions + ',top=0';
html = '<html><head><title>'+ title + '</title></head><body style="margin: 0px 0; text-align:center; "><IMG src="' + url + '" BORDER=0 NAME=image height="' + (screen.availHeight - 50).toString() +'" width="' + ((screen.availWidth - screen.availWidth/2)-20).toString() +'" onload="window.resizeTo((document.image.width-(document.image.width-(screen.availWidth - screen.availWidth/2)))+10,((document.image.height*1.3)-(screen.availHeight - 50))+((screen.availHeight - 50)*3)";></body></html>';
popup = window.open('', '', sOptions);
popup.document.open();
popup.document.write(html);
popup.document.focus();
popup.document.close();
if(document.getElementById('<%= hidTitle.ClientID %>').value!=name){
ClosePopupWin(document.getElementById('<%= hidWinRef.ClientID %>').value);
}
TrackPopupWinOpen(popup,name);
}
function TrackPopupWinOpen(winName,title) {
popupWin[popupWin.length] = winName;
var index = popupWin.length-1;
var val = popupWin.join();
document.getElementById('<%= hidWinRef.ClientID %>').value=val;
document.getElementById('<%= hidTitle.ClientID %>').value=title;
}
function ClosePopupWin(retVal) {
popupWin[popupWin.length]=retVal.split();
var openCount = popupWin.length;
for (i = 0; i < openCount; i++) {
popupWin[i].close();
}
}
:
나는 ASP/vb.net 사용하여 내 웹 응용 프로그램에서 다음과 같은 자바 스크립트를 개발 사용하고 있습니다?
제 3 자 도구는 사용할 수 없습니다. asp에서만 사용할 수있는 컨트롤을 사용할 수 있습니다.