https://github.com/matronator/axette
Very simple and lightweight AJAX implementation for Nette
https://github.com/matronator/axette
ajax ajax-link nette nette-extension nette-framework
Last synced: 5 months ago
JSON representation
Very simple and lightweight AJAX implementation for Nette
- Host: GitHub
- URL: https://github.com/matronator/axette
- Owner: matronator
- License: mit
- Created: 2021-06-16T23:20:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T11:21:59.000Z (about 1 year ago)
- Last Synced: 2025-02-03T12:27:14.695Z (about 1 year ago)
- Topics: ajax, ajax-link, nette, nette-extension, nette-framework
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/axette
- Size: 669 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README




[](https://www.codefactor.io/repository/github/matronator/axette)





[](https://plant.treeware.earth/matronator/axette)
[](https://ko-fi.com/U7U2MDBC)
# Axette
https://www.npmjs.com/package/axette
Very simple and lightweight AJAX implementation for [Nette](https://nette.org). Axette = AJAX for Nette!
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Installation](#installation)
- [With package manager (recommended)](#with-package-manager-recommended)
- [NPM:](#npm)
- [PNPM:](#pnpm)
- [Yarn:](#yarn)
- [Bun:](#bun)
- [With a `` tag:](#with-a-script-tag)
- [Migration from 1.x to 2.x](#migration-from-1x-to-2x)
- [Breaking changes](#breaking-changes)
- [Usage](#usage)
- [Custom CSS selector](#custom-css-selector)
- [Custom event listeners](#custom-event-listeners)
- [Events](#events)
- [`beforeInit`](#beforeinit)
- [`afterInit`](#afterinit)
- [`beforeAjax`](#beforeajax)
- [`afterAjax`](#afterajax)
- [Sending requests manually](#sending-requests-manually)
- [Remove `?_fid=XXXX` from URLs](#remove-_fidxxxx-from-urls)
- [Credits](#credits)
- [License](#license)
## Features
- Lightweight (**1kb** gzipped, **3kb** minified)
- Blazingly Fast
- No dependencies (no jQuery!)
- Simple to use
- Just import it, call `const axette = new Axette()` and you're done!
- Supports links and forms (`<a>` and `<form>` tags) to be handled by AJAX
- Handles snippet updates (`$this->redrawControl()`) as well as redirects (`$this->redirect()`)
- Automatically executes JavaScript inside `<script>` tags in the snippets returned from AJAX requests
- Get rid of `?_fid=6ge7` in the URL when using Flash Messages
- Attach custom callbacks to various events (`beforeInit`, `afterInit`, `beforeAjax`, etc...)
## Installation
### With package manager (recommended)
#### NPM:
```
npm install axette
```
#### PNPM:
```
pnpm install axette
```
#### Yarn:
```
yarn add axette
```
#### Bun:
```sh
bun add axette
# or
bun install axette
```
### With a `<script>` tag:
Download the [latest release](https://github.com/matronator/axette/releases/latest), move `axette.iife.js` from the `dist/` folder somewhere to your project and include it in your HTML or Latte file via a `<script>` tag.
```html
<!DOCTYPE html>
<html>
<head>
<title>Axette - AJAX for Nette!</title>
</head>
<body>
...
<!-- Local version -->
<script src="./path/to/axette.iife.js">
OR