XUL 명령 및 을 클릭하면 이벤트가 다소 다를 수 있습니다. 명령 이벤트를 사용할 때 내 함수가 호출되는 것은 아니지만XUL의 명령 이벤트에서 마우스 버튼을 누르는 방법?
는 이벤트 객체는 버튼 속성을 포함하지 않습니다.
내 질문 : 이벤트를 사용하지 않고 어떤 마우스 버튼을 감지 했습니까? 내 문제를 보여줄 수
간단한 코드 :
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script language="JavaScript">
var showMeTheButton=function(e)
{
alert(e.button);
}
</script>
<button onclick="showMeTheButton(event)" label="Click me with onclick"></button>
<button oncommand="showMeTheButton(event)" label="Click me with oncommand"></button>
</window>