Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
arguments中的callee和caller的使用
<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