您现在的位置是:首页 > 电脑技术查询 > web开发

frame中父窗口取得当前子窗口的title值,这样能不能取的到?该如何处理

编辑:chaxungu时间:2022-10-02 23:18:10分类:web开发

frame中父窗口取得当前子窗口的title值,这样能不能取的到?
frame中父窗口取得当前子窗口的title值,这样能不能取的到?

------解决方案--------------------
test.htm
<html>
<head> <title> </title> </head>
<body>
<iframe id= 'testif ' src= 'cc.htm '> </iframe>
<br/>
<input type= 'button ' value= '获取iframe的title ' onclick= 'GetTitle() '/>
<script type= 'text/javascript '>
function GetTitle()
{
alert(testif.document.title);
}
</script>
</body>
</html>

cc.htm
<html>
<head> <title> cc.htm </title> </head>
<body>
cc.htm
</body>
</html>