MozillaZine

action does not fire

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

Post Posted April 2nd, 2014, 10:10 am

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

Post Posted April 2nd, 2014, 2:50 pm

Stupid mistake....

I was using
Code: Select all
onCommand
instead of
Code: Select all
oncommand

Return to Mozilla Development


Who is online

Users browsing this forum: No registered users and 3 guests