Ever couple of months I spend an embarrassingly long time tripping on the same stupid mistake:
win.addEventListener("pageshow", onPageShow, true); .. 2215 lines all twisted together... win.removeEventListener("pageshow", onPageShow, false);
removeEventListener() call fails, silently, so the event handler can be called again. This symptom of the mistake can happen a long time from the error. The lines are so similar that it’s an easy mistake to make. The dodgy documentation on Firefox events and trying to get Firebug working on FF3.1b3 provide lots of other explanations for the extra events one sees.
I really don’t get why the
removeEventListener() does not give an error; checking this would be a nice thing for a debugger to do (someday .
In the mean time I’m going to try a different approach: setting the
capturing value on the event handler object:
win.addEventListener("pageshow", onPageShow, onPageShow.capturing); .. 2215 lines all twisted together... win.removeEventListener("pageshow", onPageShow, onPageShow.capturing);
That way they get changed in sync. Maybe you have another way?