Jquery .post() method problem -
i have following jquery function should post memberid variable.and want catch in add_comment.php file $memberid = $_request['memberid']
returns null.
$('a.comment').die("click").live("click", function(e){ var getpid = $(this).parent().attr('id').replace('commentbox-',''); var comment_text = $("#commentmark-"+getpid).val(); if(comment_text != "write comment...") { $.post("lib/actions/add_comment.php?comment_text=" +comment_text+"&post_id="+getpid,{ memberid : 5 }, function(response){ $('#commentposted'+getpid).append($(response).fadein('slow')); $("#commentmark-"+getpid).val("write comment..."); }); } });
you need url-encode (with encodeuricomponent
) comment_text
, why aren't sending in post data?
can't do:
$.post("lib/actions/add_comment.php", { comment_text: comment_text, post_id: getpid, memberid: 5 }, function (response) { //etc.
?
Comments
Post a Comment