Before doing the project encountered this problem, but too lazy no summary, today to summarize
onclick= the phrase "alert (Arguments.callee)" casually put in an element, try different browsers will have pop-up what?
Results:
IE7 and IE8-------> function onclick () {alert (Arguments.callee)} had to say that these two old boys can't keep up with the pace of the times, only by the programmer dragged away. IE6 has been abandoned by Microsoft, I heard Ali is no longer compatible to IE6
IE9, Firefox, chrome------>function onclick (event) {alert (Arguments.callee)}
There might be people who don't know arguments, first of all, to say this object, yes, an object, an array-like object
Many JS libraries take advantage of arguments objects, so agruments objects are necessary for JavaScript programmers to be familiar with.
Alert (arguments instanceof Array);//return False
Alert (typeof (arguments));//Return Object
one of the functions can create a flexible function
When the function parameter is indeterminate, but through arguments can know the specific number of function parameters
Note: Arguments is a copy of the argument, which means it is not related to the parameter!
Arguments.callee returns a reference to the function itself that is being executed, how to understand it, the reference to the function itself, yes, that is, is not very familiar, recursive Ah, recursion is not the reference itself, the callee method can be perfect to achieve recursion!
There's another way to caller, not to mention it here.
Go back to where you started.
Because there are compatibility issues, we often need to write this
function function (EV) { var event = window.event| | EV;}
Also, when a function does not have an argument, the first value of the Arguemgns object is the event object.
Discussion on Window.event | | Ev