在 xulrunner 应用程序中,我似乎无法通过 JavaScript 设置标题。我尝试过这两种方式设置:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="mywindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="go();">
<!-- your code here -->
<script type="application/x-javascript">
<![CDATA[
function go(){
document.getElementById("mywindow").title="blar";
document.getElementById("mywindow").setAttribute("title","blar");
}
]]>
</script>
</window>
DOM 检查器显示标题属性确实已更新,但它未显示在屏幕上。
最佳答案
[CDATA[
function entry_onLoad()
{
document.title = "MyTitle"
}
addEventListener("load", entry_onLoad, false)
]]>
这有效
关于xul - 如何(从 JavaScript)更改 XUL 窗口的标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/813145/