showModalDialog的应用

t1.html

1.<html>  
2.<head></head>  
3.<script>  
4.function showpage(){   
5.    alert(showModalDialog("t2.html"));   
6.}   
7.</script>  
8.<body>  
9.<button onclick="showpage()">show page</button>  
10.</body>  
11.</html>  

 

t2.html

1.<html>  
2.<head></head>  
3.<script>  
4.function setval(){   
5.returnValue="abc";   
6.close();   
7.}   
8.</script>  
9.<body>  
10.<button onclick="setval()">set value</button>  
11.</body>  
12.</html>  

 

你可能感兴趣的:(html)