我有以下XUL标记:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window width="400" height="275" title="Placeholder"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:pen="http://www.pentaho.org/2008/xul" onload="mainToolbarHandler.init()">
<script type="text/javascript">
function sayHello(txt) {
alert(txt);
}
</script>
<toolbar id="mainToolbar">
<toolbarbutton id="logout" image="mantle/images/new_report_32.png" onclick="sayHello('hello')" tooltiptext="Logout"/>
</toolbar>
</window>我试图让JavaScript函数sayHello()在工具栏按钮注销时工作,但是没有发生任何事情,也没有发生JavaScript错误。
有人知道如何让JavaScript与XUL协同工作吗?
提前感谢!
https://stackoverflow.com/questions/2310846
复制相似问题