jQuery - Mesaj ve cevap

0 Cevap php

Im benim sitelerden biri, ancak Im birkaç sorunlarınız için voteup / votedown eklemeye çalışırken:

Öncelikle burada benim jQuery:

j(".voteup").click(function(){ // when people click an up button
  j("div#response").show().html('<h2>voting, please wait...</h2>'); // show wait message
    itemID = j(this).parent('div').attr('id');; // get post id
    alert(itemID);

    j.post(voteup.php,{id:itemID},function(response){ // post to up script
      j("div#response").html(response).hide(3000); // show response
  });

  j(this).attr({"disabled":"disabled"}); // disable button
});

Benim voteup.php dosyası:

<?php

$id=$_POST['itemID'];

echo '<h2>PHP Response: You voted post '.$id.' up</h2>';

?>

Bu çalışıyor görünmüyor, ancak uyarı daha sonra gelen mesaja ID ama hiçbir şey ile geliyor. $ Id echo'd almaz.

Herhangi bir fikir?

0 Cevap