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

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);


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值