Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function show() {
- $.getJSON('/request.php?tabulka', function (data) {
- var body = $('table tbody');
- body.html(null);
- $.each(data, function (key, clovek) {
- body.html(`<tr id="${clovek.id}">` +
- `<td id="id">${clovek.id}</td>` +
- `<td id="name">${clovek.name}</td>` +
- `<td id="admin">${clovek.admin}<button onclick="zmen(this.parentNode.parentNode.id)">Zmeniť</button></td>` +
- `</tr>`);
- });
- });
- }
- function zmen(id) {
- $.getJSON(`request.php?zmen=${id}`, function (data) {
- if (data) {
- show();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement