showModalDialog和showModelessDialog

showModalDialog和showModelessDialog

 

1 . showModalDialog和showModelessDialog的异同  

同:两者弹出的窗体不能刷新  

异:前者是模态窗口,始终获得焦点;后者是非模态窗口,只不过弹出一个页面,还可以操作父窗口。  

2 . 关闭showModalDialog和showModelessDialog弹出的窗口  

< INPUT type = " button "  value = " ButtonClick "  onclick = " self.close(); " >   

3 . 怎样才让在showModalDialog和showModelessDialog的弹出新窗口里操作button,不弹出新窗口?  

< head > </ head > 之间加 < base target = " _self " >   

4 . showModalDialog的返回值  

参照例子:  

t1.html:  

< script language = " javascript " >   
function showpage()  
{  
alert(showModalDialog(
" t2.html " ));  
}
  
</ script >   
< input type = " button "  value = " getval "  onClick = " showpage(); " >   

t2.html  
< HTML >   
< HEAD >   
< Script language = " javascript " >   
<   
function SetVal()  
{  
returnValue
= " abc " ;  
close();  
}
  
// -->  
</ Script >   
</ HEAD >   
< BODY >    
< input type = " button "  value = " Btn1 "  onClick = " SetVal(); " >   
</ BODY >   
</ HTML >    

你可能感兴趣的:(showModalDialog和showModelessDialog)