Je suis ce jusqu'à présent:jQuery Parent changement HTML intérieur
$('.event-tools a').click(function()
{
var status = $(this).attr('id');
var id = $(this).parent().attr('id');
$.ajax({
type: "GET",
url: "http://localhost:8888/update/test.php",
data: "rsvp=" + status + '&id=' + id,
success: function()
{
$(this).parent().html(status);
//alert(status);
},
error: function()
{
alert('failz');
}
});
});
Avec ceci:
<span class="rsvp" id="1">
<a href="#" class="rsvp" id="Attending">Attending</a>
<a href="#" class="rsvp" id="Maybe Attending">Maybe Attending</a>
<a href="#" class="rsvp" id="Not Attending">Not Attending</a>
</span>
Lorsque je clique sur l'un d'eux et utilise le alert()
cela fonctionne en invitant la zone d'alerte, cependant, quand j'utilise le $(this).parent().html(status);
sur l'événement success:
, cela ne change pas le HTML avec le status
...
Je ne pense pas que vos identifiants sont des identifiants valides ... –