1. Firefox and ie event event processing
In ie, event objects are saved and maintained as a global variable. All browser events, whether triggered by users
, or other events, will update the object. So in the code, just call it easily
You can easily obtain the event object, and then you can obtain the elements that trigger the event for further processing.
In ff, the event object is not a global object. Generally, it occurs on site and is used on site. ff automatically transmits the event object.
Handed to the corresponding event handler function. In the code, the first parameter of the function is the event object under ff.
<button onclick="foo4()">Button 4</button>
<script>
function foo4(){
var evt=getEvent();
var element= || ;
alert()
}
function getEvent()
{ //Compatible with both ie and ff writing
if() return ;
func=;
while(func!=null){
var arg0=[0];
if(arg0){
if((==Event || ==MouseEvent) || (typeof(arg0)=="object" && && )){
return arg0;
}
}
func=;
}
return null;
}
</script>
2. Firefox and ie opponent pointer cursor are incompatible
There are two ways to write hand-shaped pointers, cursor:hand and cursor:pointer. Cursor:hand is not supported in ff, and an error is returned!
Just use cursor:pointer, both ff and ie are supported!
In ie, event objects are saved and maintained as a global variable. All browser events, whether triggered by users
, or other events, will update the object. So in the code, just call it easily
You can easily obtain the event object, and then you can obtain the elements that trigger the event for further processing.
In ff, the event object is not a global object. Generally, it occurs on site and is used on site. ff automatically transmits the event object.
Handed to the corresponding event handler function. In the code, the first parameter of the function is the event object under ff.
<button onclick="foo4()">Button 4</button>
<script>
function foo4(){
var evt=getEvent();
var element= || ;
alert()
}
function getEvent()
{ //Compatible with both ie and ff writing
if() return ;
func=;
while(func!=null){
var arg0=[0];
if(arg0){
if((==Event || ==MouseEvent) || (typeof(arg0)=="object" && && )){
return arg0;
}
}
func=;
}
return null;
}
</script>
2. Firefox and ie opponent pointer cursor are incompatible
There are two ways to write hand-shaped pointers, cursor:hand and cursor:pointer. Cursor:hand is not supported in ff, and an error is returned!
Just use cursor:pointer, both ff and ie are supported!