Test _javascript Skills for Arguments,callee,caller and so on

Source: Internet
Author: User
Tags function definition
<! 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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.