<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "lang=" gb2312 "> <pead> <pead> <title> about Argum Ents,callee,caller test </title> <meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 "/> <meta name=" author "content=" Maple Rock, CnLei.y.l@gmail.com "> <meta name=" Copyright "content=" Http://www.cnlei.com "/> <meta name=" keywords "content=" "/> <meta name=" description "content=" "/> < /head> <body> <script type= "Text/javascript" > Function Testarg () {var stemp = "Test () begins execution of the body of the \ n function definition: \ N\n "; Stemp+=arguments.callee + "\ n"; stemp+= "The length of the incoming parameter: \ n"; stemp+=arguments.length+ "\ n"; stemp+= "Contents of incoming parameters: \ n"; for (Var i=0;i<arguments.length;i++) {stemp+=arguments[i]+ "\ n"; stemp+= "\ n Click OK, start calling a ();"; alert (stemp); A (arguments); function A (args) {var stemp = "A" () starts execution \ n \ nthe functions definitionThe text: \ n '; Stemp+=arguments.callee + "\ n"; stemp+= "The length of the incoming parameter: \ n"; stemp+=arguments.length+ "\ n"; stemp+= "Contents of incoming parameters: \ n"; for (Var i=0;i<arguments.length;i++) {stemp+=arguments[i]+ "\ n"; stemp+= "\ nthe caller of the current function: \ n"; Stemp+=arguments.callee.caller+ "\ n"; stemp+= "\ n Click OK, start calling B ();"; alert (stemp); b (args); Function B (args) {var stemp = "B" () begins execution of the body of the \ n. Stemp+=arguments.callee + "\ n"; stemp+= "The length of the incoming parameter: \ n"; stemp+=arguments.length+ "\ n"; stemp+= "Contents of incoming parameters: \ n"; for (Var i=0;i<arguments.length;i++) {stemp+=arguments[i]+ "\ n"; stemp+= "\ nthe caller of the current function: \ n"; Stemp+=arguments.callee.caller+ "\ n"; stemp+= "\ n Click OK, start calling C ();"; alert (stemp); C (args); The function C (args) {var stemp = "C ()" begins execution of the body of the \ n. Stemp+=arguments.callee + "\ n"; stemp+= "The length of the incoming parameter: \ n"; stemp+=arguments.length+ "\ n"; stemp+= "Contents of incoming parameters: \ n"; for (Var i=0;i<arguments.length;i++) {stemp+=arguments[i]+ "\ n"; stemp+= "\ nthe caller of the current function: \ n"; Stemp+=arguments.callee.caller+ "\ n"; Alert (stemp); Alert ("args.callee:\n" +args.callee); Alert ("args.callee.caller:\n" +args.callee.caller); Alert ("testarg.arguments.callee.caller:\n" +testarg.arguments.callee.caller); } ; </script> <input type= "button" onclick= "Testarg (' iecn.net ', ' Deep Blue butterfly ', ' maple Rock ');" value= "Testarg (' iecn.net ', ' Deep Blue butterfly ', ' Maple rock '; "/> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]