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

window.showModalDialog中的button如何控制其打开它的那个窗口中的一个IFRAME的SRC属性

2012-02-10 
window.showModalDialog中的button怎么控制其打开它的那个窗口中的一个IFRAME的SRC属性在一个页面中(页面A

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不介意吧

热点排行