I have a user table and would like that when I click the edit button I load the edit form without giving refresh on the page with the selected id using jquery would it be possible? Here is the code below:
<table class="table">
<thead class="thead bg-info text-light">
<tr>
<th scope="col">ID</th>
<th scope="col">Nome</th>
<th scope="col">E-mail</th>
<th scope="col">Nível</th>
<th scope="col">Editar</th>
<th scope="col">Excluir</th>
</tr>
</thead>
<tbody>
<?php
include "../config/cnn.php";
$query = $pdo->query("Select * FROM USUARIOS;");
while ($linha = $query->fetch(PDO::FETCH_ASSOC))
{
echo'<tr>';
echo'<td>'."{$linha['id']}".'</td>';
echo'<td>'."{$linha['administrador_nome']}".'</td>';
echo'<td>'."$linha['administrador_email']}".'</td>';
echo'<td>'."$linha['administrador_nivel']}".'</td>';
echo'<td><a id="edituser"href="'."../frmEditar/frmEditUser.php?id="."{$linha['id']}".'">
<span><i class="far fa-edit"></i></span></a></td>';
echo'<td><a>
<span><i class="fas fa-trash"></i></span></a></td>';
echo'</tr>';
}?>
</tbody>
</table>
Abaixo segue o script jquery que estou usando no sistema
<script>
$("#edituser").click(function(){
$("#main").load("../frmEditar/frmEditUser.php");
});
</script>