我有这个工作脚本(我知道它不完整):
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;
现在行
$(element).closest('span.rsvp-status').html("I'm Attending – <a href='javascript:;' class='remove' rel='remove'>Remove</a>");
正在工作,但是当我做类似的事情来获得这个li的父ul时,它不起作用。 有什么想法吗?