首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

js弹窗(showModalDialog)封闭返回传递参数及激活事件

2012-07-04 
js弹窗(showModalDialog)关闭返回传递参数及激活事件父窗口中的jsfunction openwin(){xwindow.showModalD

js弹窗(showModalDialog)关闭返回传递参数及激活事件

父窗口中的jsfunction openwin(){     x=window.showModalDialog("win.html",window,"dialogHeight:200px;dialogWidth:400px;center:yes;help:No;resizable:No;status:No;");     if (x=="haha"){//当关闭时,判断返回值        alert(x);//关闭窗口后激活alert    }  } 子窗口中的jsfunction closethis(){        Window.returnValue = "haha"; //定义返回值      close(); } <input type="button" onclick="closethis()" value="关闭" />当触发onclick事件时调用closethis()函数 该函数返回"haha"  if (x=="haha")//当关闭时,判断返回值 如果相等则 alert(x).

?

热点排行