如何使用jQuery确认单击链接 [英] How to confirm clicking on a link using jQuery

查看:100
本文介绍了如何使用jQuery确认单击链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在HTML表中有很多链接,当单击时会删除相应的行(通过GET参数调用PHP脚本)。

I have many links in a HTML-table, which delete corresponding row, when clicked (calling a PHP-script via GET parameter).

他们都有一个class delete_row

They all have a class delete_row.

如何使用jQuery显示确认('真正删除?')对话框,什么时候点击这样的链接?

How could I please display a confirm('Really delete?') dialog using jQuery, when such a link is clicked?

当在对话框中选择时,当然会阻止关注该链接。

And of course prevent following that link when No has been selected in the dialog.

推荐答案

试试这个。

$('.delete_row').click(function(){
    return confirm("Are you sure you want to delete?");
})

这篇关于如何使用jQuery确认单击链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆