更改window.open的标题

0 javascript

我点击了一个window.open函数调用,打开一个.swf albumplayer.

var win = null;
function NewWindow(wizpage, wizname, w, h, scroll){
LeftPosition = (screen.width) ? (screen.width-w)-8 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height=' + h + ',width=' + w + ',top= 100,' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable';
win = window.open(wizpage, wizname, settings);
} 
Run Code Online (Sandbox Code Playgroud)

我想改变打开的窗口的标题,它有一些有意义的标题(一个常量'专辑播放器'或者其他东西会很好),所以这不使用默认的文件名/ application-shockwave ...文本.

谢谢您的帮助.

小智 8

然后把它放到onload事件:

win.onload = function() { this.document.title = "your new title"; }
Run Code Online (Sandbox Code Playgroud)