参考四种函数调用:http://www.cnblogs.com/qlqwjy/p/7660013.html

        http://www.cnblogs.com/qlqwjy/p/7660375.html

1.首先理解自调函数:(有名自调与匿名自调)

  两个圆括号,第二个括号传递参数即可自调。

<script type="text/javascript">
(function test(para){
alert("test函数"+para)
})('1'); (function(para){
alert("匿名函数"+para)
})('2');
</script>

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbUAAACGCAIAAADVUYM9AAAIx0lEQVR4nO3dTW8b1R6A8fk0SIVPgGDRT+BN1ND6ilWL7gIhQST4BkdCKDiyLJRdpFazuUt20JfQlBEIFhXUTdUlyjiLJHJuFTtJU8ccFjM+PufMfya2M6mH5PnJUonnxWOjPjpnxukEGgAgCeZ9AABQUfQRAGT0EQBkwf8AAJLgAAAgCV69etVutzc2Nh4BACzBs2fPnj592u/3BwAAS7C+vk4cASAr+Obrb+Z9DABQRcGjR4/mfQwAUEXBgwcP5n0MAFBFwf379+d9DABQRfQRAGT0EQBk9BEAZPQRAGT0EcDV0mw2W61Wr9dLfuz1eq1Wq9lsZtekjwCullartbS01Gg0er1er9drNBpLS0utViu7Jn0EcLX0er2VlZUkkUkck1Zm16SPAK4ck8iCOA7oI4AryEyr6SMAjJk4NhoNM9Fmfg0A/vWZJJEXdX0mUkFQC+Nz7qV4vxf1Gv8GcVgLiqlo8nXttYEr6a1+v+cS9tHOjPWykcqLjLVB3mEmq9jbWbsrenNxWCtoWvFSAOdwJftYvLecpXFYMx2KlJO6SJn147Am7zuNodnI6VruVmYhI0Lg7aOPwrKzexOHtbw9iDuIVBAoVbDrgkNi/AjMyQX00Z42Zv7qjheONymYzXp9lLb29+AuspYkh+IcXbKuNXor6F7he/Ze0H3Xo6eK0ltCH913Nv2Is3AQC1xFJffR+zvm/hgpu15xGEbJn8qs78xb/T6OFwm7tSe74x+d6kShvYUVAmt3ScKs0oi9EBoofRj+ygV9LBrRnmt+PWnwB/QRyCi3j0V1KIiKu7o0p5bGqOMRn7dbszDvJXNrlKYoJ73jU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+XrJLXbv8+9btBJQG4qKSJSgJwUUkTlQTgopImKgnARSVNVBKA69rt3y5dJX+b+t2gkgBcF1TJrVdav9L3ilaIdEeLK1BJAHOilEre29GZzo6+t/Of1tZ3qqu6+kLLdl5QSQDzp5RK3qrvr233te6tL+/d2OprrZubewvLe2vbfa37zzaOq6u6+vws+777tdnTWjefU0kA86esGffWK61br26u6h3fOLGzo6uN1sLy3mLDt7mwiEoCmK1yKhmdddIe/vdss9vR/Wfre2vbfX3SXVs+aWrdibv3vPnMT8ypJIC5UkolNw601rq53e3o/tbzXidfwLh7q75vzrLXWzqZoWffuVE/ppIA5k4plXzc6mutm3FvUEnPWDJZc2cwZnzc0lqfPT53FqkkgItVSiVvrpw0rUp6xpLVVV19caa1bm4dDypp2aCSAOZQSVdvTptp6/pbzbNkKp0fSyYT804zG0uaM+7WTSoJYA6VWMnm5t7C8v7jltYnp3dX9d24r096d1dP00pGuqN156SffDSSGTeAN0NJlTxcHHyU527c62wf30oqORhgPts43jjQunVy49v9hfVufkqutdYHVBLA/Cn7JxSPb9VbydVq46L2/gff6Zsrewsrh9VVXf3u3xv5D5YvD5ZSSQBzhf/twkQlAbiopIlKAnBRSROVBOCikiYqCcBFJU1UEoCLSpqoJADX+1/8sbhyeGdNX46vxZXD9z7/Y+p3g0oCcH3/5J93P33y1kc/v/XhT2/810c/v/fZr98/+Wfqd4NKAnAdHR3t7u7uXBa7u7tHR0dTvxtUEgAkVBIAJFQSACRUEgAkVBIAJFQSACRUEgAkVBIAJFQSACRUEgAkVBIAJFQSACRUEgAkVBIAJFQSACRUEgAkVBIAJFQSACRUEgAklW63+/Dhw8PDw1k/EwCYR/8DkTufGgRxgkwAAAAASUVORK5CYII=" alt="" />

2.有名字函数的调用:

  alert(test)是打印test函数的语句,test相当于一个变量,值为整个声明函数的语句。test(1)可以理解为(test)(1),也就是先用括号将test变量包起来然后加个(1)形成函数调用形式

function test(para){
alert("test函数"+para);
}
alert(test);
test(1);

aaarticlea/png;base64,iVBOR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++kJuNZab9NHAGVS9O8X7l5rdOIz0dYJ661vbuurC5szC+9ri7p2+78r6UvE54dL6SOAkuDfpzDoIwAHfTToIwAHfTToIwAHfTToIwAHfTToIwAHfTToIwDH1788m114f2NJn43H7ML7r35+Nt1XQR8BOP548u+XPz658N29C9/++dk/vrv31U9//fHk3+m+CvoIwLGzs7OxsbF+VmxsbOzs7Ez3VdBHAJDRRwCQ0UcAkNFHAJDRRwCQ0UcAkNFHAJDRRwCQ0UcAkNFHAJDRRwCQ0UcAkNFHAJDRRwCQ0UcAkNFHAJDRRwCQ/Q+XMyRBdVQoFAAAAABJRU5ErkJggg==" alt="" />

3.匿名函数的调用:

  alert(fun)是打印匿名函数的语句,fun相当于一个变量,值为整个声明函数的语句。fun(2)可以理解为(fun)(2),也就是先用括号将fun变量包起来然后加个(2)形成函数调用形式.

var fun = function(para){
alert("匿名函数"+para)
}
alert(fun);
fun(2);

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbEAAACSCAIAAABE/WPKAAALB0lEQVR4nO3dT2sc5x3A8X01gaSvoKQHv4K5GKu2Sk526KEUWkHyDp6bukKIIHoR2MwbyK3xwbHdISGBlgRZxsfgkQ6SkQvelWR5rTw97M78nv+zUma03t3vB0Ei7ezMroK+eZ75tz1tOD8/f/jw4QgAllWPJgJAjSYCgKCJACBoIgAImghgqW1ubm5tbQ0Gg/G3NBHAUtva2lpbW+v3+4PBYDAY0EQAS20wGGxsbIyz2O/3aSKAZVdncW1tjSYCWHaDwaDf79NEAJAg9vv9jY0NmghgqXV+jKVQvV6Wl6282Nh6u9rGPCjzrJemiumXNZcGllLn5+IsYBPNtBibLVQsLMYTYi9zvIj5PGN1qTdX5lmiY+lHATShiU1rizxa5lndnkJZeStUvXyZZ+F1TwJYP8lqWfRZ9YOM/ICO0MT02go1TWPKPIutIbiCQvV6SiVWnXhJjBOBLnXfRHNK6P25yoPylMRM1Wli6NnuGuyHjEfGL8V6deNljVFaonXJ9+xs0H7X1Y9SuW2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ya/3lqW+dEUe95bl/U9+HfdDIJEA3G7c/eWKJfLG3V/G/RBIJAA3EhmTSAAaEhmTSAAaEhmTSAAaEhmTSACaG3d/vnKJ/HncD4FEAnCbUCI33oq8lQfaCqF0pHQFEglgGlSSyAdbkulsyYOtv0Ssn9SXpP5Kym29IpEApkwlibzT2F3e7InEq/M7tzZ6ItJa35mZ31ne7In0Xqwd1Zek/vI0+3n+sR6LSOsliQQwZaqaaG+8Fdl7e3tJtlwjxM6W1Jt7M/M7s03X5iWLSCSAS1RNIsPTThrDv16sdzvSe7G6s7zZk+Pu8vxxS6QTdR8421mcj5NIANOjkkSu7YuItDa7HeltvIw7xfxF3TuNXXNyvbonycQ8+8mtxhGJBDBdKknkk72eiLSiuJ9IxygyWXOrP1p8sicip0/O3UQSCWCCKknk7cXjlpVIxyiyviT1V6ci0to46ifSskYiAUybii7XnLTS0PU2WqfJDLo4ikzm451WNoo0J9p7t0kkgGlTYSJb6zsz87tP9kSOT+4vyf2oJ8fx/aWTNJGhdEQ6xz0R2XrFRBvAu6CiRB7M9r+1cz+KO5tHd5JE9oeWL9aO1vZF9o5vfb07s9otzsRFRPZJJIApU/UvIB7daewl16aNS9i7f/9Gbi/uzCwe1Jek/s3/bhW/PT7fX0oiAUwP/hmLmEQC0JDImEQC0JDImEQC0JDImEQC0JDImEQC0JDImEQC0Hz02W+ziwf3luVqPGYXDz7892/jfggkEoDbt0///OCfT9/7+Mf3/vGfd/7x8Y8f/uu/3z79c9wPgUQCcDs8PNze3t66Kra3tw8PD8f9EEgkAKhIJACoSCQAqEgkAKhIJACoSCQAqEgkAKhIJACoSCQAqEgkAKhIJACoSCQAqEgkAKhIJACoSCQAqEgkAKhIJACo/g98d/K+yo1hMQAAAABJRU5ErkJggg==" alt="" />

4.匿名函数也可以带函数名字:

var fun = function test3(para){
alert("匿名函数"+para)
}
alert(fun);
fun(2);

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbMAAACZCAIAAAAqz0M0AAAL0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HWupdm4+p5xnr5mkfjMd3zvtb65vnCmaN6AObTSPXub1/1rOp5xnrtHd1+c6O17h1cjqtn2aN6AN6Dhu5mvOsV7Rod9G7yqWt1rJdPhIe9cqxnznD796kegPegwer19k/WNk+f97W+evdkRz9JR/oqe7LzrqheoodaD69G+VvzmOEC+DAaqt75+vitJ0/SbHh4+SCv3ngA+Grvcu9M6/7VvX+drj27rk6Btdb6jOoBWL6mfyPt8kGnn9+NNW7anv75S31/+2Rt+7y9o9tf/u9e9Y3Km+OlVA/AUvGvDwCQheoBkIXqAZCF6gGQheoBkIXqAZDlT//8cX37/NGuXo2P9e3zT/7xY+hkqR6A7OsXv/zxby8++vSbj/7y79/9x6fffPL3l1+/+CV0slQPQHZxcXF8fHy0Ko6Pjy8uLkInS/UAyEL1AMhC9QDIQvUAyEL1AMhC9QDIQvUAyEL1AMhC9QDIQvUAyEL1AMhC9QDI8hsl4yXJYfUDFAAAAABJRU5ErkJggg==" alt="" />

5.直接量函数

  只要是表达式语法,脚本宿主就认为 function 是一个直接量函数,如果什么都不加,光以 function 开头的话则认为是一个函数声明,把 function 写进一个表达式内部,比如四则运算,宿主也会将其当作是一个直接量,如下:

  只有函数表达式可以被立即调用,函数声明不可以.

alert(10+function(para){return para;}(5))

+function (a) {
alert(a)
}('a');

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbkAAABnCAIAAAASdauUAAAHSUlEQVR4nO3d30obWRzAcd9mwX2EFton8EYQynZdCS17IexSoX2D3ElamVIoBC8k9brXvXBZCWuLsLTYVXpVMFFBSUUzMzqJ6W8vxszMmTkzJzYTTeL3Q2A3mT9JZul3z8lMmol37961AeDWWFpasiyr2Wz6d5vNpmVZS0tL2VtN0EoAt4plWQsLC6VSqdlsNpvNUqm0sLBgWVb2VrQSwO3SbDafP3/u59IPpd/N7K1oJYBbJ8hlj6Fs00oAt1Aw9aaVAKAXhLJUKgWTcebgAKCIndvxc3kd53aqxYmJqUqtz71k73dQzzEKapWpiWzFau/r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QQwZxkWsLV3vLhxstMRufi8WZdNZygXg83651EBbemJ9C6G7qV/zIIB3L6MCni2PL6cZdMZ9A77q24BxwPD/d3+7qlI52Lpr5PF7avwNFlE5JQCApivrH8qrr9a7bhndX0nf09+fiorlePFylmpLqWn/y2FL4reGC+lgADmhv8ZwUUBAY0ooIsCAhpRQBcFBDSigC4KCGhEAV0UENCIArooIKDRT3++Xa6crTUkH7flytn9P97OcBwoIKDRs5effvzt5Z0Hz+/88vd3f3vw/P7v/zx7+WmG40ABAY3Oz8+Pjo7aeXF0dHR+fj7DcaCAAPSigAD0ooAA9KKAAPSigAD0ooAA9KKAAPSigAD0ooAA9KKAAPSigAD0+h8VA9MY48MfXgAAAABJRU5ErkJggg==" alt="" />

var fun = function test3(para){
return "3";
}();
alert(fun);

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbAAAABxCAIAAAA772HYAAAHKUlEQVR4nO3dy04bVxyAcZ4mUtInqNIFT+ANgoKrrELURVWpRUrewDtqy7Ii7yyB/ALZNQsIpKNEyaJKxEVZRoy9wMhUYoyBHJx/F3M8njM3PDDgZPz9ZCmx52J7Ij6d4xmHmQ0AwMbGxsbGjAIAKKWUIogAoBFEANAIIgBoBBEANIIIABpBBACNIAKARhABQCOIAKARRABToVqt1mo1x3Hcu47j1Gq1arXqX4cgApgKtVptZWWlXC47juM4TrlcXllZqdVq/nUIIoCp4DhOpVJxm+jW0I2jfx2CCGBaeE2MrKEiiACmhzdTJogApppXw3K57M2dmTIDmEaBkypuEzM7qWKVZmYKTfvGrzJpv7f1HN8Du1mYSVayxl/XvzYwlW73spscBtHfFd/TWqW4qvg2iHuZ7ir+7Xy7S3pzdrOQELHkpQCuZZqCmLy3mKV2s+CFxyoZbbNK3vp2sxC9b10/byMjZLFbeQsZ8wF3iSCOll0dGLtZiNtD5A6s0sxMqZSw64SXxAgRuHPZBdE/Ewz9rI4WjjZJmKAGghi1dXAP5iLfEvelGK/OXdc3PksIXeJ7Djyh+a6HDyW1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AgiANf9x29yF8Q3aQ8CQQSg1K0Fce9c5FzW41awpCeJKxBEAHcvkyCut8XTa8t6+6uI8UixLsVPkqz9iSACmKhMgrhUPWocDETU5mpnfm8gIq2dztxqp3EwEBnsbveLdSnuX3qPB287SkRa+wQRwERlNWXeOxfpni/WpR01+uu1pVjrzq12FmpRmycsIogA7kw2QbQuezp9X3d3Lnoy2N3sNA4GcnbRWD1rifTsi/XIUoZn1gQRwKRkEsTtYxGR1sFFTwZ7+6oXjp19sVQ98k+TN7viTrG9R+arfYIIYJIyCeJWdyAiLVsNgxgxQnTXbA9HgltdEbncunEBCSKAzGQSxMXKWcsIYsQIsViX4qdLEWnt9YdBNGwTRACTldFJlS8tnbXBXuvSnQuHR4juzLrX8kaI/ilzd5EgApisDIPY2unMrR5tdUXOvqzVZc0eyJlaq3/RQbSkJ9I7G7iXHDJlBvDNySiIJwvD62bWbNU76C+5QRwOG3e3+9vHIt2z+b+O5jYvwnNqEZFjgghgorL+6l5/qdp1zxf7Tisf/fxcFiuducpJsS7F5//Nh6/NXh0uJYgAJoX/3EERRAAugqgIIgAXQVQEEYCLICqCCMBFEBVBBOAiiIogAnD99Of7hcrJckPycVuonDz8433ag0AQASil1IvXn3/87fW9Ry/v/fL3d3979PLh7/+8eP057UEgiACUUur09PTw8LCdF4eHh6enp2kPAkEEAI0gAoBGEAFAI4gAoBFEAND+B49DYMrL9FxLAAAAAElFTkSuQmCC" alt="" />

JS函数调用原理($.ajax原理)的更多相关文章

  1. 封装ajax原理

    封装ajax原理 首先处理 用户如果不传某些参数,设置默认值 type默认get 默认url为当前页 默认async方式请求 data数据默认为{} 处理用户传进来的参数对象 遍历,拼接成key=va ...

  2. AJAX原理总结

    AJAX全称 Asynchronous JavaScript and XML(异步的JavaScript 和XML) 同步和异步 异步传输是面向字符的传输,单位是字符 同步传输是面向比特,单位是帧,传 ...

  3. Js(javaScript)的闭包原理

    问题?什么是js(javaScript)的闭包原理,有什么作用? 一.定义 官方解释:闭包是一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数),因而这些变量也是该表达式的一部分.  小编 ...

  4. 大话AJAX原理

    大话AJAX原理 一.什么是Ajax Ajax(Asynchronous JavaScript and XML的缩写)是一种异步请求数据的web开发技术,对于改善用户的体验和页面性能很有帮助.简单地说 ...

  5. 一张图搞懂Ajax原理

    本文整理在,我的github上.欢迎Star. 原理 说起ajax,就不得不说他背后的核心对象XMLHttpRequest,而说到XMLHttpRequest我觉得,从它的readyState状态说起 ...

  6. JS垂直落体回弹原理

    /* *JS垂直落体回弹原理 */ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...

  7. 什么是ajax,ajax原理是什么 ,优缺点是什么

    AJAX工作原理及其优缺点   1.什么是AJAX?AJAX全称为“Asynchronous JavaScript and XML”(异步JavaScript和XML),是一种创建交互式网页应用的网页 ...

  8. Ajax原理、优缺点及应用场景

    前言 Ajax的全称为Asynchronous JavaScript And Xml,是一种web客户端与服务器端异步通信的技术,如今,可以说是web开发人员必须掌握的的一项技能了.本文讲述了Ajax ...

  9. ThinkPHP 中使用 IS_AJAX 判断原生 JS 中的 Ajax 出现问题

    问题: 在 ThinkPHP 中使用原生 js 发起 Ajax 请求的时候.在控制器无法使用 IS_AJAX 进行判断.而使用 jQuery 中的 ajax 是没有问题的. 在ThinkPHP中.有一 ...

  10. JS实现的ajax和同源策略

    一.回顾jQuery实现的ajax 首先说一下ajax的优缺点 优点: AJAX使用Javascript技术向服务器发送异步请求: AJAX无须刷新整个页面: 因为服务器响应内容不再是整个页面,而是页 ...

随机推荐

  1. iOS JS 交互之利用系统JSContext实现 JS调用oc方法

    ios js 交互分为两块: 1.oc调用js 这一块实现起来比较简单, 我的项目中加载的是本地的html,js,css,需要注意的是当你向工程中拖入这些文件时,选择如下操作,(拖入的文件夹是蓝色的, ...

  2. 沙盒(SandBox)

    iOS 应用沙盒机制就是指 iOS 应用程序只能在为该程序创建的文件系统中读取文件,不可以去其它地方访问,此区域被成为沙盒,所以所有的非代码文件都要保存在此,例如图像,图标,声音,映像,属性列表,文本 ...

  3. LNMP一键安装包开启pathinfo和rewrite模式

    此教程适用于集成安装包lnmp,官网是https://lnmp.org/ 一. 开启pathinfo #注释 下面这一行 #include enable-php.conf #载入新的配置文件 incl ...

  4. python爬虫: 豆瓣电影top250数据分析

    转载博客 https://segmentfault.com/a/1190000005920679 根据自己的环境修改并配置mysql数据库 系统:Mac OS X 10.11 python 2.7 m ...

  5. v2ex站长专访 - 100offer专访Livid:不仅仅是V站站长

    转载自: https://www.douban.com/group/topic/121611313/ 前几天上网时偶然发现v2ex站长的blog(https://livid.v2ex.com/),了解 ...

  6. jQuery获取动态添加的元素,live和on的区别

    今天给大家说一下如果用jQuery获取动态添加的元素,通常如果你在网页上利用jQuery添加一个元素,那么用平常的jQuery获取元素的方法无效的获取不到的.可以用以下的方法获取动态元素!假设我们现在 ...

  7. Python语言的简介

    ___________________________________________________________我是一条分割线__________________________________ ...

  8. Java Web系统常用的第三方接口

    1.    Web Service 接口 1.1 接口方式说明和优点 在笔者的开发生涯中,当作为接口提供商给第三方提供接口时,以及作为客户端去调用第三方提供的接口时,大部分时候都是使用 Web  Se ...

  9. 面试之mybatis和hibernate的区别

    mybatis是支持普通SQL查询.存储过程和高级映射的优秀持久层框架.封装了 几乎所有的JDBC代码和参数的手工设置 ,以及结果集的检索: 封装了:1,获取连接,执行sql,释放连接. 2,sql的 ...

  10. Primer C++第五版 读书笔记(一)

    Primer C++第五版 读书笔记(一) (如有侵权请通知本人,将第一时间删文) 1.1-2.2 章节 关于C++变量初始化: 初始化不是赋值,初始化的含义是创建变量时赋予其一个初始值,而赋值的含义 ...