小黑小波比.从别的方法传参数

var RefreshTool = function(arg, tel, code) { //页面图片控制这里可以加参数
        _("#Last").attr("tel", "");
        _("#Last").attr("code", "");
        if (arg == 1) {
            _("#Setp1").css("background", "url('Context/images/password/u6.png')")
            _("#Setp2").css("background", "url('Context/images/password/u36.png')")
            _("#Setp3").css("background", "url('Context/images/password/u0.png')")
            _("#Setp1 img").attr("src", "Context/images/password/u4.png")
            _("#Setp2 img").attr("src", "Context/images/password/u4.png")
            _("#Setp3 img").attr("src", "Context/images/password/u44.png")
            _("#Last").hide();
            _("#First").show();
        } else if (arg == 2) {
            _("#Setp1").css("background", "url('Context/images/password/u36.png')")
            _("#Setp2").css("background", "url('Context/images/password/u6.png')")
            _("#Setp3").css("background", "url('Context/images/password/u0.png')")
            _("#Setp1 img").attr("src", "Context/images/password/u44.png")
            _("#Setp2 img").attr("src", "Context/images/password/u44.png")
            _("#Setp3 img").attr("src", "Context/images/password/u4.png")
            _("#First").hide();
        } else {
            _("#Setp1").css("background", "url('Context/images/password/u0.png')")
            _("#Setp2").css("background", "url('Context/images/password/u36.png')")
            _("#Setp3").css("background", "url('Context/images/password/u6.png')")
            _("#Setp1 img").attr("src", "Context/images/password/u8.png")
            _("#Setp2 img").attr("src", "Context/images/password/u8.png")
            _("#Setp3 img").attr("src", "Context/images/password/u44.png")
            _("#Email").hide();
            _("#Phone").hide();
            _("#Last").attr("tel", tel);
            _("#Last").attr("code", code);
            _("#Last").show();
        }
    };


1.这里定义两个参数 tel和code

_("#Last").attr("tel", "");
_("#Last").attr("code", "");

2.然后在arg==3下传参数

_("#Last").attr("tel", tel);
_("#Last").attr("code", code);

在客户端的js

调用这个函数把参数传过去

方法1:{
RefreshTool(3, tel, code);
}

在这个方法2中接收传过来的参数

方法2:{
tel:_(#Last).attr("tel"),
code:_(#Last).attr("code"),
}



最后可以在服务端js

测试是否传到值

console.log(e.params.tel);

console.log(e.params.code);


你可能感兴趣的:(nodejs,小黑小波比,传参数值方法,两个方法之间传参数)