zoukankan      html  css  js  c++  java
  • 闭包

    结合ajax段代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="jquery.min.js" language="javascript" type="text/javascript">
    </script>
    <script src="wkl_ajax.js" language="javascript" type="text/javascript">
    </script>
    <script type="text/javascript">


    function load()
    {
    _ape_json_.search(
    "http://localhost/me.php", function(meed){

    alert(meed.just
    +"1...");
    });
    shit();
    }

    function shit()
    {
    var test = "xiaoxiao"
    _ape_json_.search(
    "http://localhost/me.php", function(meed){

    alert(meed.just
    +"12..."+test);
    });

    }


    function f1(){
    var n=999;
    nAdd
    =function(){n+=1}
    function f2(){
    alert(n);
    }
    return f2;
    }

    var result=f1();
    result();
    // 999
    nAdd();
    result();
    // 1000

    </script>
    </head>

    <body onload="load()">
    <div class="me">test</div>
    </body>
    </html>

      

  • 相关阅读:
    JasperReport
    iconv
    Groovy
    Groovy
    file
    PowerShell 自动合并 db first 的dbcontext
    获取存储过程的名称和信息
    傻瓜式同步svn到git
    强大的生成pdf,word,等等文档工具
    iphone x 底部横条适配
  • 原文地址:https://www.cnblogs.com/wangkangluo1/p/2152739.html
Copyright © 2011-2022 走看看