xul - 如何(从 JavaScript)更改 XUL 窗口的标题?

标签 xul xulrunner

在 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/

相关文章:

java - Windows下Eclipse SWT中使用64位XulRunner

browser - 如何为浏览器或 iframe 元素(Firefox 扩展)动态设置 "src"

javascript - 调用在 (xul) 浏览器元素中定义/链接的 javascript 函数

java - org.eclipse.swt.browser.XULRunnerPath 不影响使用的浏览器

javascript - 在 Xulrunner 应用程序中信任 https url 的自签名证书

linux - 带有 xulrunner 的单文件应用程序 - 可能吗?

firefox - XUL 测试工具

firefox - 基于Firefox的 `-app`开关构建独立的XUL程序

javascript - XUL。 Tree.为什么子项会掉落?

html - XUL 应用程序中的 "text-overflow: ellipsis;"