对JQuery来说,我添加了下面的JQuery代码,并将其移到我的代码中,现在它不起作用我忘了我做了什么,有人可以通过将下面的代码放在正确的位置来修复我的代码。JQuery代码问题?
$('a').click(function() {
$('#changes-saved').remove();
});
return false; // prevent normal submit
});
JQuery代码。
$(function() {
$('#changes-saved').hide();
$('.save-button').click(function() {
$.post($('#contact-form').attr('action'), $('#contact-form').serialize(), function(html) {
$('div.contact-info-form').html(html);
$('#changes-saved').append('Changes saved!').show().pause(1000).hide();
});
return false; // prevent normal submit
});
$('a').click(function() {
$('#changes-saved').remove();
});
return false; // prevent normal submit
});
});