【发布时间】:2010-01-02 21:46:08
【问题描述】:
$("#submit_js").click(function() {
var commentmsg = $('#comment').val();
$.post(
"user_submit.php",
{comment: $("#comment").val(), aid: imgnum, uid:$("#uid").val()},
function(data){
/*alert(data);*/
//$('#greetings').html('Your choice was submitted successfully. Thank You for voting.');
$('#confirm_msg').addClass("on");
$('#care_parent').addClass("off");
$('#fb_user_msg').html(commentmsg);
//$('#fb_user_msg').html( commentmsg );
});
});
以上是我的 jquery POST 函数。在回调函数中,我正在做一些 html 的东西。这是成功的 POST 版本。这意味着,当 POST 过程完成或添加到数据库时。现在在我的 user_Submit.php 中,我正在检查是否应该将数据添加到数据库中。
是否可以修改回调函数,以便如果我不添加到 user_Submit.php 中的数据库,我应该向用户显示一些其他消息...
我真正想问的是,如何让 PHP 向 JS 传递 0/1 值?有人可以帮忙吗?
【问题讨论】:
标签: php javascript jquery