JavaScript传递参数方法


1、SetTimer传递参数

setTimeout(function (obj) {
    obj.myScroll = new IScroll('#wrapper', { click: true });
    obj.myScroll.on('scrollStart', function () {
        document.activeElement.blur();
    });
    obj.myScroll.on('scrollEnd', function () {

        if (obj.isMore === false) {
            obj.setScrollHeight();
            return;
        }
        if (this.y <= this.maxScrollY) {
            if (obj.isMore === false) {
                obj.setScrollHeight();
                this.refresh();
                return;
            }
            if (obj.getData !== null) {
                obj.getData();
            }
            this.refresh();
        } else {
            this.refresh();
        }
    });
}, 100,this);

2、AjaxSuccess传递参数

var obj = this;
var url = this.url;
//有分页标志才启用分页参数
if (this.isUsePage) {
    url = url + "&pageIndex=" + this.pageIndex + "&pageSize=" + this.pageSize;
}
$.ajax({
    url: url,
    type: "post",
    dataType: "json",
    data: this.datas,
    success: function (p_datas) { obj.isLoading = false;
    },

 注意红色部分


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM