<html>
<head>
<title> This is a title </title>
<script type="text/javascript">
function test(){
var topFrameStr = "<html><head><title>Title test</title></head></html>"
var topFrameset = self.open("","_blank");
topFrameset.name = "pupup";
topFrameset.opener = window.self;
topFrameset.document.write(topFrameStr);
topFrameset.document.close();
return;
}
</script>
<head>
<body>
<input type="button" value="Click me!" onclick="test()" >
</body>
</html>如上个例子,动态写入新打开窗口的页面内容(我关注的是title部分),用chrome打开,title是undefined,用IE,FireFox打开,title就完全没问题。
请教有没有workaround的方法,使得chrome动态写入title生效。感激万分。

解决方案 »

  1.   

    请问你用chrome打开也还是Title正常?
      

  2.   

    和LZ一样,
    用输出的内容保存成HTML,用chrome没有问题,估计是chrome有BUG?
      

  3.   

    I found the solution - just encase anyone else has the same problem...'about:blank' needs to be added as the first parameter of the window.open function:var topFrameset = self.open("about:blank","_blank");