Created
August 26, 2014 07:58
-
-
Save hacke2/c7b95c759b608b7f0ff6 to your computer and use it in GitHub Desktop.
arguments中的callee和caller的使用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div onclick="test('hello')">Click me!</div> | |
<script type="text/javascript" language="javascript"> | |
function test(arg,arg2) { | |
var _e=window.event||arguments.callee.caller.arguments[0]; | |
alert("arguments.callee:\n"+arguments.callee+"\n"); | |
alert("arguments.callee.arguments[0]:\n"+arguments.callee.arguments[0]+"\n"); | |
alert("arguments.callee.caller:\n"+arguments.callee.caller+"\n"); | |
alert("arguments.callee.caller.arguments[0]:\n"+arguments.callee.caller.arguments[0]+"\n"); | |
alert("_e:\n"+_e+"\n"); | |
alert("_e.type:\n"+_e.type+"\n"); | |
alert("arguments.length:\n"+arguments.length+"\n"); | |
alert("arguments.callee.length:\n"+arguments.callee.length); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment