Ho risolto da manuale. Pare funzionare.
Codice PHP:
$(function() {
$(".submit_reg_graph").click(function() {
var dataString = 'tutti i dati che servono...';
var volte = 0;
$('html, body').animate({scrollTop:0}, 500, 'linear', function() {
if(volte == 0){
$.ajax({
type: "POST",
url: "login_g.php",
data: dataString,
success: function(msg) {
$('html, body').animate({scrollTop:1}, 500, 'linear'),
$('#form_reg').html("
<h3 style=\"margin-top: 5px;\">Esito Registrazione</h3>\n")
.append("" + msg + "")
.fadeIn(5000);
}
});
}
volte = 1;
return false;
});
return false;
});
});