日期:2014-05-16  浏览次数:20413 次

window.showModalDialog中的button怎么控制其打开它的那个窗口中的一个IFRAME的SRC属性
在一个页面中(页面A)点击按钮打开了一个
window.showModalDialog    
在被打开的window.showModalDialog     中有一个页面(页面B)  
我想点击页面B中   的一个按钮     使

页面A的   iframe中的src属性变化  
怎么弄啊  


关键是页面B在     window.showModalDialog   中

解决后给高分

------解决方案--------------------
//a.html

<html>
<head>
<title> a </title>
<script>
function show(){
var str=window.showModalDialog( "b.html ");
document.getElementById( "iframe1 ").src=str;
}
</script>
</head>
<body>
<iframe name=iframe1 id=iframe1 src= "# "> </iframe>
<input type=button value= "ok " onclick=show()>
</body>
</html>

//b.html
<html>
<head>
<title> b </title>
<script>
function a(){
returnValue= "http://www.baidu.com ";
window.close();
}
</script>
</head>
<body>
<input type=button value= "ok " onclick=a()>
</body>
</html>

只不过在改变src时关掉了Modal窗口,lz不介意吧