Pregunta

Tengo el siguiente marcado 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>

Estoy tratando de obtener la función de JavaScript sayHello () para el trabajo cuando se hace clic en el cierre de sesión ToolBarButton sin embargo nada ocurre y no hay errores de JavaScript ocurrir también.

¿Alguien sabe cómo conseguir JavaScript trabajar con XUL?

Gracias de antemano!

¿Fue útil?

Solución

Trate con oncommand="sayHello('hello')"

Otros consejos

Dos sugerencias:

scroll top