1. All code in Firefox that uses event-related is not available.
Event is the global object that IE encapsulates, control all events, but this object does not exist in Firefox, so it cannot be used in Firefox, especially Event.keycode is also unable to obtain.
Workaround:
The following JS encapsulates the event object, directly in the page reference, the original events code can be tried in Firefox:
<script>/*firefox----This JS encapsulates the event object and is validated to be supported under Firefox.
----*/function __firefox () {htmlelement.prototype.__definegetter__ ("Runtimestyle", __element_style);
WINDOW.CONSTRUCTOR.PROTOTYPE.__DEFINEGETTER__ ("event", __window_event);
event.prototype.__definegetter__ ("srcelement", __event_srcelement);
function __element_style () {return this.style;
function __window_event () {return __window_event_constructor ();
function __event_srcelement () {return this.target;
function __window_event_constructor () {if (document.all) {return window.event;
var _caller = __window_event_constructor.caller;
while (_caller!=null) {var _argument = _caller.arguments[0];
if (_argument) {var _temp = _argument.constructor;
if (_temp.tostring (). IndexOf ("Event")!=-1) {return _argument; } _caller = _caller.caller;
return null;
} if (Window.addeventlistener) {__firefox (); /*end Firefox------------------------------------------------* * </script>
2. Event.returnvalue = False cannot be used
Although the event was encapsulated, this method is still not supported.
Workaround:
When calling Event.returnvalue = False, use the following methods:
function Setreturnvaluefalse ()
{
if (document.all)
{
window.event.returnValue = false;
}
else
{
event.preventdefault ();
}
}