# atk14js

> Ajax adapter for ATK14 framework.

Latest version **1.2.5** (published 2026-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install atk14js
pnpm add atk14js
yarn add atk14js
bun add atk14js
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2026-10-25 |
| First published | 2018-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Bohdan Ganický |
| Maintainers | yarri |
| Keywords | atk14, ajax, jQuery, adapter |

## Links

- npm: https://www.npmjs.com/package/atk14js
- Repository: https://github.com/atk14/Atk14Js
- Homepage: https://github.com/atk14/Atk14Js#readme
- Issues: https://github.com/atk14/Atk14Js/issues
- npm.io page: https://npm.io/package/atk14js

## Dependencies (1)

- [jquery](https://npm.io/package/jquery.md) >=1.12

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.2.5 (latest) — 2026-10-25
- 1.2.4 — 2026-10-24
- 1.2.3 — 2024-02-23
- 1.2.2 — 2019-10-02
- 1.2.1 — 2019-09-20
- 1.2.0 — 2019-09-16
- 1.1.1 — 2018-11-11

## README

Atk14Js
=======

Ajax adapter for the [ATK14](https://github.com/atk14/atk14) framework.

Progressively enhances links and forms with `data-remote`, `data-method` and `data-confirm`
attributes, turning them into AJAX requests or method-spoofed form submissions, without having
to write any JavaScript by hand.

## Installation

```
npm install atk14js
```

or

```
bower install atk14js
```

Depends on jQuery >=1.12. Include `src/atk14.js` after jQuery on the page.

## Usage

### Remote links and forms

```html
<a href="/articles/1" data-remote>Load article via AJAX</a>

<form action="/articles" method="post" data-remote>
  ...
</form>
```

Clicking the link or submitting the form fires an AJAX request instead of a normal navigation.
Listen for the result on the element itself:

```js
$("a[data-remote]").on("ajax:success", function( e, data, status, xhr ) {
  // handle the response
});
```

Available events: `ajax:beforeSend`, `ajax:success`, `ajax:complete`, `ajax:error`.

### Overriding the HTTP method

```html
<a href="/articles/1" data-method="delete" data-confirm="Really delete?">Delete</a>
```

Since browsers only send GET/POST from links, `data-method` submits a hidden form instead; for
methods other than GET/POST a hidden `_method` field is added so the server can detect the
intended verb.

### Confirmation dialogs

```html
<a href="/articles/1" data-method="delete" data-confirm="Really delete?">Delete</a>
```

Before the action runs, a cancelable `confirm` event is fired on the element, followed by
`window.confirm()`. Returning `false` from a `confirm` handler aborts the action.

### Custom URL for a link

If `data-href` is present on a link, it is used instead of `href`. (Forms always use their
`action` attribute.)

### Calling it manually

```js
ATK14.handleRemote( document.getElementById( "my-link" ) );
```

### Current action

`ATK14.action` exposes the value of `<meta name="x-action">`, so client code can read the
current server-rendered action/route name.

## License

MIT

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