action does not fire

Discuss building things with or for the Mozilla Platform.
Post Reply
chucke1992
Posts: 5
Joined: April 2nd, 2014, 10:04 am

action does not fire

Post by chucke1992 »

I am currently writing java library for XUL.

In order to test it I've create simple window. And generated code is

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" height="300" id="hello" width="300">
    <script>function action() { alert('hello world!'); }</script>
    <button label="alert" onCommand="action"/>
</window>


But when I click on button - alert does not show up. Even If I set

Code: Select all

action();
or

Code: Select all

onCommand="alert('hello world!');"
it doesn't show up.
I am using XULExplorer and Mozilla with Remote XUL plugin.

What's the problem?
When I simply create only script like this using library

Code: Select all

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" height="300" id="hello" width="300">
    <script>alert('hello world!');</script>
</window>

alert is shown up.


P.S I've installed old version of mozilla browser(2.0.0.8) and it doesn't work there too
chucke1992
Posts: 5
Joined: April 2nd, 2014, 10:04 am

Re: action does not fire

Post by chucke1992 »

Stupid mistake....

I was using

Code: Select all

onCommand
instead of

Code: Select all

oncommand
Post Reply