1

ID別のphpファイルに投稿するjQueryコードがあります

<script type="text/javascript">

$(function() {
   //More Button
   $('.more').live("click",function() {
      var ID = $(this).attr("id");

      if(ID){

         $("#more"+ID).html('<img src="moreajax.gif" />');

         $.ajax({
            type: "POST",
            url: "ajax_more.php",
            data: "lastmsg="+ ID, 
            cache: false,
            success: function(html){
                $("ol#updates").append(html);
                $("#more"+ID).remove();
            }
         });

   }else{
      $(".morebox").html('The End');   
   }    
   return false; 
   });
});

</script>

私が知りたいのは、「最後のマッサージID」とともに別のクエリを投稿する方法です。値 (pid) を出力する mysql クエリがあります。これを「最後のマッサージ ID」と一緒に投稿するにはどうすればよいですか。ありがとうございます。

4

2 に答える 2

3
$.ajax({
            type: "POST",
            url: "ajax_more.php",
            data: "lastmsg="+ ID + "&pid=" + your_pid, 
            cache: false,
            success: function(html){
                $("ol#updates").append(html);
                $("#more"+ID).remove();
            }
         });
于 2012-05-05T15:46:08.660 に答える
1

これが私の解決策です:

var salji = {
  rate: score,
  image_id: img_id
};

$.ajax({
    type: "POST",
    url: "widgets/rate.php",
    data: salji,
    success: function(msg){
        alert('wow');
    }
});
于 2012-08-08T14:05:22.817 に答える