1.event
IE9 below does not support direct acquisition of event objects, so write compatibility is required:
var event = event?event:window.event;
IE8 below are not supported for Event.target, but can be compatible with event.srcelement:
var eventtarget = Event.srcelement?event.srcelement:event.target;
2.document.getelementsbyclassname ("...")
IE8 below is not supported, there is no workaround; can only be done for the current code hack
3.new Date (str) format error
If Str is not a string such as the standard Time format "2014/12/9", the new date will fail and return an error result;
The invalid Date is returned under Chrome, and Nan is returned under IE;
When dealing with error results, remember to take Nan
4.getYear Get Year
In IE, get the normal 2014,2013 value, and in Chrome and other browsers get 114,113, less than the normal year 1900; Get full year should use the getFullYear () function, in each browser to get 2014, 2013 normal year values
5.stopPropagation Block bubbling
IE9 do not support the use of the Event.stoppropagation () function, you should use event.cancelbubble = true;
var e = event?event:window.event;
if (e.stoppropagation) {
E.stoppropagation ();
}
else{
E.cancelbubble = true;
}
---Encounter some more, it is time to take note of the browser compatibility and solutions to the knowledge point-----
Browser compatibility: Javascript