showModalDialog如何調用父頁的事件? 如何在用showModalDialog打開頁面后,點擊頁面上的按鈕,關閉頁面,並執行父頁面的事件?請幫忙,留下JS代碼,謝謝 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var itemNumber = window.showModalDialog('ItemListPopWindow.aspx',window,'dialogWidth:920px;dialogHeight:600px;help:0;resizable:0;status:0;scroll:0;'); var undefined; if (itemNumber != undefined && itemNumber != "0") { document.getElementById("<%=btnOK.ClientID %>").click(); } 1.showModal 的时候将父窗体的window对象作为参数传给子窗体:// parent.htmlvar args = {"parentWin" : window }; // 这里我作为子属性包装传递,// 还可以指定其他参数// args.firstName = "Jack";var retVal = window.showModalDialog('child.aspx', args);// child.html// 得到父窗体的 window 对象var parentWin = window.dialogArguments.parentWin;window.location.href = "newpage.html"; window.location.href = "newpage.html";>>>parentWin.location.href = "newpage.html";2.能不能在子頁面中添加刷新的JS,如果在父頁面當中刷新,無倫子頁面是點那個關閉的,都會刷新!請幫忙解決下!謝謝!--------------------------那么你可以对返回值做标记,表示执行哪些事件// child.html// ...window.returnValue = {"ShouldRefresh": true};// more values;window.returnValue.result = 911;// ...window.close();// parent.htmlvar retVal = window.showModalDialog('child.html', args);if(retVal) { // 如果用户直接关闭,返回值为空 if(retVal.ShouldRefresh) window.location.href = "newpage.html"; // else if alert(retVal.result);} 把“是否”转换成中文问题 需要一些好的,现成的树形菜单样式及源码 送分题 速度进 帮忙看看这段代码 是高手的进来看下啊!html控件使用cs页百的方法。。 为什么我用VS2003新建项目的时候提示“路径未找到”? 大家帮我看看这个问题如何解决! DataGrid表格问题 .net数据库连接问题 安装了iewebcontrols.msi后为什么在VS.net web控件中还是找不到TREE? 请教DATATABLE的一个问题??????? 列“id”已属于另一个 DataTable
var undefined;
if (itemNumber != undefined && itemNumber != "0")
{
document.getElementById("<%=btnOK.ClientID %>").click();
}
showModal 的时候将父窗体的window对象作为参数传给子窗体:// parent.html
var args = {"parentWin" : window }; // 这里我作为子属性包装传递,
// 还可以指定其他参数
// args.firstName = "Jack";
var retVal = window.showModalDialog('child.aspx', args);// child.html
// 得到父窗体的 window 对象
var parentWin = window.dialogArguments.parentWin;
window.location.href = "newpage.html";
>>>
parentWin.location.href = "newpage.html";
2.
能不能在子頁面中添加刷新的JS,如果在父頁面當中刷新,無倫子頁面是點那個關閉的,都會刷新!
請幫忙解決下!謝謝!
--------------------------
那么你可以对返回值做标记,表示执行哪些事件// child.html
// ...
window.returnValue = {"ShouldRefresh": true};
// more values;
window.returnValue.result = 911;
// ...
window.close();// parent.html
var retVal = window.showModalDialog('child.html', args);
if(retVal) { // 如果用户直接关闭,返回值为空
if(retVal.ShouldRefresh) window.location.href = "newpage.html";
// else if
alert(retVal.result);
}