Jquery对话框确认到一个特定的带有php变量的href链接


Jquery dialog confirmation to a specific a href link with php variable

我想弹出一个jquery确认对话框,当我按下删除一个项目从我的数据库,上面的代码是在一个while($records=mysql_fetch_aray),所以我有几个记录:

echo"<tr>
    <td>".$registo["id_produto"]."</td>
    <td><img src='data:image/jpeg;base64,".base64_encode($registo["pic"])."' width='80' height='80'></td>
    <td>".$registo["nome"]."</td>
    <td>".$registo["preco"]."</td>
    <td>".$registo["quantidade"]."</td>
    <td>".$categoria."</td>
    <td>".$registo["descricao"]."</td>
    <td>".$registo["cura"]."</td>
    <td>".$registo["aroma"]."</td>
    <td><a href='deleteProduto.php?id={$registo["id_produto"]}'><i class='fa fa-times'></i> Delete</a></td>
    </tr>";

当我按下"删除"按钮时,我想弹出一个jquery确认对话框,其中包含"是"answers"否",当按下"是"时,转到"deleteproduct .php",其中包含我想要删除的项目的相应id。

我已经搜索了这个,但只发现这个工作与一个形式,我只希望它与'a href'链接与各自的"id"工作

我想知道你的代码如何在没有大量警告和错误的情况下工作。

我想你可能没有注意到它,因为你在剩下的代码中做得很正确,但是

"...?id={$registo["id_produto"]}'>...";

绝对不是正确的字符串组合。必须是

"...?id=".$registo["id_produto"]."'>...";