JQuery code problem?
Posted
by SLAPme
on Stack Overflow
See other posts from Stack Overflow
or by SLAPme
Published on 2010-03-23T07:39:33Z
Indexed on
2010/03/23
7:43 UTC
Read the original article
Hit count: 131
New to JQuery, I added the following JQuery code below and moved it around in my code and now it won't work I forgot what I did, can someone fix my code by placing the below code in its correct place thanks.
$('a').click(function () {
$('#changes-saved').remove();
});
return false; // prevent normal submit
});
JQuery code.
$(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
});
});
© Stack Overflow or respective owner