Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
扩展jqueryautopage_Jquery - Fatal编程技术网

扩展jqueryautopage

扩展jqueryautopage,jquery,Jquery,我正在做一个项目,需要使用。我需要一种方法来查询有关寻呼机的一些状态信息,因此我修改了库的代码,以包含isLoading和hasMore函数。他们工作得很好 --- a/jquery.autopager-1.0.0.js 2009-10-13 16:42:41.000000000 +0000 +++ b/jquery.autopager-1.0.0.js 2013-04-28 00:02:33.000000000 +0000 @@ -98,6 +98,14 @@ options.

我正在做一个项目,需要使用。我需要一种方法来查询有关寻呼机的一些状态信息,因此我修改了库的代码,以包含isLoading和hasMore函数。他们工作得很好

--- a/jquery.autopager-1.0.0.js 2009-10-13 16:42:41.000000000 +0000
+++ b/jquery.autopager-1.0.0.js 2013-04-28 00:02:33.000000000 +0000
@@ -98,6 +98,14 @@
        options.start(currentHash(), nextHash());
            $.get(nextUrl, insertContent);
            return this;
+       },
+
+       isLoading: function() {
+           return active;
+       },
+
+       hasMore: function() {
+           return (nextUrl ? true : false);
        }

    });
我的问题是:是否有任何方法可以从我自己的代码中,将这些新函数合并到autopager中,从而避免修改外部库

我已经试过了,但我试图引用的变量在这种情况下似乎不可用:

jQuery.extend(jQuery.autopager, {
  isLoading: function() {
    return active;
  }
});

你能发布更多的代码吗。extend应该可以工作,但麻烦在于细节。以下是autopager库的完整源代码,它只有一个文件,171行长: