Jquery没有将post数据发送到php?
我的问题是jQueryPost并没有将数据发送到其他页面。通过单击图像将数据发送到likeemail.php页面。日期存储在图像的id中Jquery没有将post数据发送到php?,php,jquery,Php,Jquery,我的问题是jQueryPost并没有将数据发送到其他页面。通过单击图像将数据发送到likeemail.php页面。日期存储在图像的id中 <a href="viewProfile.php?id=<?php echo $record['user_id']; ?>"><img class="img-rounded" id="<?php echo $record['user_id']; ?>" src=" <?php echo
<a href="viewProfile.php?id=<?php echo $record['user_id']; ?>"><img class="img-rounded" id="<?php echo $record['user_id']; ?>" src=" <?php echo "../shadi/images/" . $record['user_photo1'] ?>" alt=""
width="70%" height="20%"> </a>
你能告诉我那里的虫子是什么吗。我已经在LikeEmail.php以外的其他页面上运行了这个jquery方法,它运行得很好,但是jquery post没有向LikeEmail.php发送数据。php尝试在
单击时发生这种情况,可能是为了防止事件传播
$('.img-rounded').click(function(e){
e.stopPropagation(); // not sure if needed
e.preventDefault();
$.post("LikeMail.php",
{fname: this.id},
function(data){
$('.respond').html(data);
}
);
});
尝试在
单击时执行此操作,可能是为了防止事件传播
$('.img-rounded').click(function(e){
e.stopPropagation(); // not sure if needed
e.preventDefault();
$.post("LikeMail.php",
{fname: this.id},
function(data){
$('.respond').html(data);
}
);
});
如果我删除(查看控制台消息,它将以404响应)
如果我删除,请防止默认行为(查看控制台消息,它将以404响应)
请防止默认行为请检查任何控制台消息!它是空的。无任何内容请检查任何控制台消息!它是空的。没什么,是的。首先,我检查了没有标签的代码。它工作得很好。添加标记后,它会产生问题。首先,我检查了没有标签的代码。它工作得很好。在添加标签后,它产生了问题。我已经添加了它。。Jquery已开始发送数据,但现在不发送锚标记working@ZainFarooq如果同时转到其他位置,则不能在等待结果的情况下执行ajax调用。如何等待数据
并执行$('.respond').html(数据)代码>如果您通过单击锚定标记到达某个位置?我已经添加了它。。Jquery已开始发送数据,但现在不发送锚标记working@ZainFarooq如果同时转到其他位置,则不能在等待结果的情况下执行ajax调用。如何等待数据
并执行$('.respond').html(数据)代码>如果通过单击锚定标记转到某个位置?
$('.img-rounded').click(function(e){
e.stopPropagation(); // not sure if needed
e.preventDefault();
$.post("LikeMail.php",
{fname: this.id},
function(data){
$('.respond').html(data);
}
);
});