This is incorrect syntax and will run or attempt to run mouseupListener as soon as it is parsed without assigning it to any mouse behavior:
Code:
document.onmouseup = new Function(mouseupListener());
It should be (maybe it is, maybe you just left out the quote marks):
Code:
document.onmouseup = new Function("mouseupListener()");
I would at least try changing it to:
Code:
document.onmouseup = mouseupListener;
Or perhaps you meant:
Code:
document.onmouseup = function(){mouseupListener()};
In which case the solution is the same and you can also do:
Code:
document.onmouseup = function(e){mouseupListener(e)};
But no matter how you do it, for it to have any hope of working in Firefox, the mouseupListener function should look something like so:
Code:
function mouseupListener(e){
if (!e)
{
alert("!e");
e = window.event;
}
alert("before");
var x = e.pageX;
alert("after");
}
or so:
Code:
var mouseupListener = function(e){
if (!e)
{
alert("!e");
e = window.event;
}
alert("before");
var x = e.pageX;
alert("after");
}
If you want more help, perhaps you could replicate the problem on a simpler scale and paste in the code here.
BTW - Prior to IE 9, there is no e.pageX in Internet Explorer. And even in IE 9, if you are relying upon window.event - it still has no e.pageX.
Bookmarks