This is missing a semi colon or curly bracket or something and I can’t find out where or how.
Any suggestions on how to debug this sort of issue would help. I added one on the line firebug told me and it still didn’t work nor make sense.
$(document).ready(function () {
$('#go').click(function () {
$.ajax({
type: 'POST',
data: $('#newsletter').serialize(),
url: $('#newsletter').attr('action'),
success: function()
{
$('#thankYou').show(1000,setTimeout(
function(){
$('#thankYou').hide()
})
,3000);
};
});
return false;
});
});
it is still showing a syntax error with this
function()
{
$('#thankYou').show(1000,setTimeout(
function(){
$('#thankYou').hide()
})
,3000);
}
It looks like 3 problems:
show()syntax.setTimeout()syntax.This should work; See it in action at jsFiddle. :
PS: For just showing and hiding, jQuery provides:
(“We don’t need no stinking setTimeout.”)