I'm using the following code in firefox extension, that should alert when double click event occur, but when I double click nothing happens.
var Test = {
x: function(e) {
alert(e.target.defaultView.location.href);
}
}
window.addEventListener("dblclick", function(e) { Test.x(); }. false);
Try changing the dot to a comma before the last parameter:
window.addEventListener("dblclick", function(e) { Test.x(); }, false);
// .^.
// | here...
Your closure also expects a parameter e
to be passed to it:
window.addEventListener("dblclick", function(e) { Test.x(e); }, false);