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