zoukankan      html  css  js  c++  java
  • 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;
        },

     注意红色部分

  • 相关阅读:
    php上传excle文件,csv文件解析为二维数组
    transition的使用
    数组
    快捷键
    SCSS历史介绍与配置
    18-async函数
    this的指向问题
    媒体查询
    13-Set和Map数据结构
    15-Iterator和for…of循环
  • 原文地址:https://www.cnblogs.com/zhaogaojian/p/10724348.html
Copyright © 2011-2022 走看看