Why does this come back with an error:
jQuery('#the_form').submit(function() {
jQuery.ajax({
url: 'stats.php?increment=true',
success: function() {
alert('Load was performed.');
},
error: function() {
alert('Load wasnt performed.');
}
});
return true;
});
and this doesn't (return is false, all else is same):
jQuery('#the_form').submit(function() {
jQuery.ajax({
url: 'stats.php?increment=true',
success: function() {
alert('Load was performed.');
},
error: function() {
alert('Load wasnt performed.');
}
});
return false;
});
and how do I call that script before submission (to an external action)?