I have this working script (i know its incomplete):
function rsvpNew(selector,function_url) {
$(selector).livequery('click',function(){
var select = $(selector).attr('rel');
var event_id = $(this).parents('ul.event-options').attr('rel');
element = this;
switch(select) {
case "attending":
$.ajax({
type: "POST",
url: "/events/set_member/"+function_url,
data: "event_id="+event_id,
beforeSend: function() {
$("<span class='notice'>Saving...</span>").prependTo('body');
},
complete: function() {
$('span.notice').fadeOut(500);
$(element).closest('span.rsvp-status').html("I'm Attending – <a href='javascript:;' class='remove' rel='remove'>Remove</a>");
}
});
break;
Now the line
$(element).closest('span.rsvp-status').html("I'm Attending – <a href='javascript:;' class='remove' rel='remove'>Remove</a>");
Is working, but when I do something similar to get the parent ul of this li, it doesn't work. Any ideas?