# jquery-listloader

> simple jquery ajax list loader.

Latest version **0.0.4** (published 2015-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install jquery-listloader
pnpm add jquery-listloader
yarn add jquery-listloader
bun add jquery-listloader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2015-10-17 |
| First published | 2015-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | RryLee |
| Maintainers | rrylee |
| Keywords | list, loader |

## Links

- npm: https://www.npmjs.com/package/jquery-listloader
- npm.io page: https://npm.io/package/jquery-listloader

## Recent versions

- 0.0.4 (latest) — 2015-10-17
- 0.0.3 — 2015-10-17

## README

# jQuery-listLoader

Click to get database records, using some scene that no pagination.

## Getting Started

### Getting the repository

1. [Downloading](https://github.com/RryLee/jquery-listloader/archive/master.zip)
2. run `npm install jquery-listloader`

### Guide

**Your backend need to return json data like this.**

```json
{
    "items": [
        {
            "id": "1",
            "title": "title1",
            "description": "body1"
        },
        {
            "id": "2",
            "title": "title2",
            "description": "body2"
        },
        {
            "id": "3",
            "title": "title3",
            "description": "body3"
        }
    ],
    "last": false,
    "count": 3
}
```

`items` => your most important data.
`last` => weather the data has been gotten.
`count` => the record total count.

**Your frontend maybe like this.**

```html
<div class="container">
    <div class="items">
        <div class="item">
            <h3 data-field="title"></h3>
            <p data-field="description"></p>
        </div>
    </div>
    <button class="items-loader"></button>
</div>
```
```js
(function($) {
    $('.container').listLoader({
        source: 'articles.php',
        step: 2
    });
})(jQuery)
```

### Some Options

* `source` required -- the backend uri to get data.

* `step` optional default(2) -- each count to get

* `itemsElement` optional default(.items) -- The items css selector

* `itemElement` optional default(.item) -- The item css selector

* `loaderElement` optional default(.items-loader) -- The loader button css selector

* `hideLoader` optional default(true) -- After get all data, the loaderElement hide.

* `finishedFunction` optional -- your own callback function after get all data.

## License

MIT

---
_Source: https://npm.io/package/jquery-listloader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
