日期:2014-05-19  浏览次数:20871 次

如何让父窗口title动态等于子窗口的title
我知道用HtmlGenericControl可以动态改变title的文字,但是我不清楚怎么获取子窗口的title。
不想用Request.QueryString,感觉这个太麻烦,frame之间传值是不是有更方便的方法啊?JS实现也行的。
3Q先~

------解决方案--------------------
main page:
<html>
<head>
<title id= "tt "> hello </title>
</head>
<body>
<input type= "button " value= "open " onclick= "toOpen(); "/>
<script language= "javascript ">
function toOpen()
{
window.open( "newPage.htm ", "_blank ");
}
</script>
</body>
</html>
==============
child page:
<html>
<head>
<title id= "aa "> nihao </title>
<script language= "javascript ">
function changeParentTitle()
{
var win=window.opener;
win.document.title=document.title;
}
</script>
</head>
<body onload= "changeParentTitle(); ">
</body>
</html>
------解决方案--------------------
好象答非所问哦.

你大概是问frame中的子窗口改变父窗口的title.

child page:
<html>
<head>
<title id= "aa "> nihao </title>
<script language= "javascript ">
function changeParentTitle()
{
window.top.document.title=document.title;
}
</script>
</head>
<body onload= "changeParentTitle(); ">
</body>
</html>

------解决方案--------------------
<body onload= "changeParentTitle(); ">

应该是lz想要的了