Skip to content

Commit

Permalink
ajax: Naja initialization info [Closes #1053]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 23, 2024
1 parent ff77765 commit 703e01f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/cs/ajax.texy
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ npm install naja
<script src="https://unpkg.com/naja@2/dist/Naja.min.js"></script>
```

Nejprve je potřeba knihovnu [inicializovat |https://naja.js.org/#/guide/01-install-setup-naja?id=initialization]:

```js
naja.initialize();
```

Aby se z obyčejného odkazu (signálu) nebo odeslání formuláře vytvořil AJAXový požadavek, stačí označit příslušný odkaz, formulář nebo tlačítko třídou `ajax`:

```html
Expand Down
6 changes: 6 additions & 0 deletions application/en/ajax.texy
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ npm install naja
<script src="https://unpkg.com/naja@2/dist/Naja.min.js"></script>
```

First you need to [initialize |https://naja.js.org/#/guide/01-install-setup-naja?id=initialization] the library:

```js
naja.initialize();
```

To make an ordinary link (signal) or form submission an AJAX request, simply mark the respective link, form, or button with the `ajax` class:

```html
Expand Down

0 comments on commit 703e01f

Please sign in to comment.