改变父窗口的title

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<frameset rows="0,*" frameborder="no" border="0" framespacing="0">
  <frame src="" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frame src="index.html" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<noframes><body>
</body></noframes>
</html>

 

 

index.html 调用如下的js

window.onload = function changeFramePageTitle(){
 window.parent.document.title = "I am a new title";
}

即可改变父页面的title

你可能感兴趣的:(it)