如何设置iExplorer弹出窗口的标题?

问题描述 投票:0回答:1

我使用以下代码打开新的弹出窗口。

 var sFeatures =  'toolbar=0, directories=0, location=0, menubar=0, status=0, titlebar=0, scrollbars=0, resizable=0'+ ', width=' + screen.availWidth + ', height=' + (screen.availHeight - 40);

var newWin = window.open(url, '_blank', sFeatures, true);

弹出的标题有一个问题。在页面加载之前,显示的是url而不是标题。当页面加载后,标题被设置。我需要在页面加载前更改标题。我试过下面的代码,但它不工作。

newWin.document.title = 'Anything';
popup internet-explorer-11 title
1个回答
0
投票

你使用的是哪个浏览器?你也可以尝试使用

newWin.onload = function () { this.document.title = "Anything"; }

但我认为在页面加载前不能更改标题。onload 也会等待一切加载完毕。实际的标题来自于 <title> 元素,如果页面没有完全加载,那么你就不能在该元素上运行。

© www.soinside.com 2019 - 2024. All rights reserved.