Javascript 通过按钮传递变量(Ajax模式)

Javascript 通过按钮传递变量(Ajax模式),javascript,php,jquery,ajax,button,Javascript,Php,Jquery,Ajax,Button,在表中(包含我的数据库中的记录、客户凭证),我为每一行设置了一个删除按钮。 我希望,如果单击delete按钮,这将删除该行,并将记录的ID传递给deletecustomer.php 当我单击delete按钮时,会出现一个ajax模式,询问您是否要确认操作。 问题是,如果我单击CONFIRM(在模式中),我的模式将进入delete-ute.php(在这里我有行删除的查询),但ID没有传递 在delete-ute.php中,如果查询正常(delete complete),我会收到一条消息,如果无法完

在表中(包含我的数据库中的记录、客户凭证),我为每一行设置了一个删除按钮。
我希望,如果单击delete按钮,这将删除该行,并将记录的ID传递给deletecustomer.php
当我单击delete按钮时,会出现一个ajax模式,询问您是否要确认操作。
问题是,如果我单击CONFIRM(在模式中),我的模式将进入delete-ute.php(在这里我有行删除的查询),但ID没有传递
在delete-ute.php中,如果查询正常(delete complete),我会收到一条消息,如果无法完成删除,则会收到另一条消息
单击“确认”后,我始终会收到“确定”消息,但该客户尚未被删除。
我想问题不在于deletecustomer.php,因为如果我使用一个简单的javascript警报,查询就可以了,并且我成功地传递了标识符,但是使用ajax模式,标识符不会传递

这是我第一次使用ajax,所以我认为问题在于ajax代码

我的主页(newcustomer.php)中表的代码

我在deletecustomer.php中采用如下值

$customeridd=(int) $_GET['customerid']; 
抱歉,如果这是一个愚蠢的错误或愚蠢的问题^”
并在建议中致谢

请尝试以下代码:

<?php echo '<a class="button icon-trash with-tooltip confirm" onclick="return confirm(\'Are you sure?\');" href="deletecustomer.php?customerid='.$idcustomer.'">Delete</a>'; ?>

您可以这样使用:

<?php 
  echo '<button type="input" class="button icon-trash with-tooltip confirm" onclick="openConfirm('.$idcustomer.')" href="deletecustomer.php?customerid='.$idcustomer.'" title="Delete">button</button>'; 
?>

谢谢你的回答:)
<?php echo '<a class="button icon-trash with-tooltip confirm" onclick="return confirm(\'Are you sure?\');" href="deletecustomer.php?customerid='.$idcustomer.'">Delete</a>'; ?>
<?php 
  echo '<button type="input" class="button icon-trash with-tooltip confirm" onclick="openConfirm('.$idcustomer.')" href="deletecustomer.php?customerid='.$idcustomer.'" title="Delete">button</button>'; 
?>
function openConfirm(id)
    {
        alert(id);
        $.modal.confirm('Sicuri di voler cancellare il cliente?', function()
        {
            window.location.href = "deletecustomer.php?customerid="+id; //the php file where I have the delete query


        }, function()
        {
            window.location.href = "newcustomer.php";

        });
    };