码迷,mamicode.com
首页 > Web开发 > 详细

JS 函数参数

时间:2015-10-23 13:25:02      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

1.简单的无参函数调用
function Test1(Func)
{
    Func();
}
function Test2()
{
     alert("我要被作为函数参数啦!");
}
//使用
Test1(Test2);

 

2.简单的有参数的函数调用
function Test1(Func)
{
    Func(data2);
}
function Test2(data1)
{
    alert(data1);
}
//使用
Test1(Test2("李杰"));

 

3. 匿名函数作为函数参数,好好理解一下
function Test1(Func)
{
    Func("要在这里赋值");
}
function Test2
{
    function(data1){alert(data1);}
}
//采招使用的地方
 __grid1.findRow(function (row) {
            rowIndex = __grid1.indexOf(data[i]) + 1;
            if (row.ExpertSortName == dataValue && rowIndex != __grid1.indexOf(row) + 1) {
                return true;
            }
        });

 

 

JS 函数参数

标签:

原文地址:http://www.cnblogs.com/lijiebolg/p/4903998.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!