开发者

Trying to figure out $.post callback functionality for jQuery

I have a jquery script that is working fine except being able to send the data via $.post and receive a response back开发者_JAVA技巧. here is the relevant code:

$.post(
    'test.php',
    { userfname: f.editfname, userlname: f.editlname, userid: v.user }, 
    callback: function(data) {
        $.prompt('You have successfully added this book to your cart!');
    }
);

I want the results of test.php to be placed inside the results div


The code contains invalid syntax. Try this:

$.post('test.php',
{
    userfname: f.editfname,
    userlname:f.editlname,
    userid:v.user
}, 
function(data)
{
    $.prompt('You have successfully added this book to your cart!');
});


Like this you mean?

$("div#results").html(data);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜