0
我有一個使用Javascript打開彈出文件選擇器窗口的頁面。用戶選擇文件後,父窗口將重定向到加載文檔的頁面。我已經準備好了很多有同樣問題的帖子,但還沒有找到解決方案。我有以下代碼:Javascript - 將父頁重定向到彈出的新頁面
家長
openChildWindow("FileMan2.aspx?UN=<%= Header1.UserNumber %>&FormMode=OPEN&RetObj=PRINTLETTER&PrintCase=" + OpenFlag, 550, 350);
function openChildWindow(URL, width, height) {
if (window.showModalDialog) {
window.showModalDialog(URL, window.self, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;center:yes;scroll:no;resizable:no;status:no;unadorned:no;edge:raised");
} else {
window.open(URL, "docman", "width=" + width + ", height=" + height + ", screenX=0, screenY=0, status=no, scrollbars=no,toolbar=no,menubar=no,top=200,left=200,modal=yes");
}
}
兒童
var URL = window.location.protocol + "//" + window.location.host + "/CaseLetter.aspx?Case=<%= CaseNumber %>&UN=<%= Header1.UserNumber %>&Letter=" + file + "&FileName=" + file + "&COID=<%=GlobalVar.LawFirm %>&FilePath=<%= AddPath %>";
window.opener.location.href = URL;
我得到的錯誤是「無法獲得財產「的位置'未定義或空引用。我在這裏做錯了什麼?
'window.opener'不'window.showModalDialog' https://forums.asp.net/t/1123330.aspx?using+window+opener+with工作+在showModalDialog – chiliNUT