0
如何使用jQuery隐藏#changes-saved
代码?jQuery显示问题?
例如,假设用户点击提交按钮,然后离开当前网页,然后返回到网页,并且#changes-saved
不再显示,直到再次单击提交按钮时显示代码。
这里是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('<li>Changes saved!</li>').show().pause(1000).hide();
});
return false; // Prevent normal submit.
});
});