doesn't work.. can't find any solution to prevent submit page reload only if ajax status is 200...
$('form.insarticolo').submit(function (e){
function getUrlStatus(url, callback) {
$.ajax({
type: "POST",
url : url,
data: ({ testo : $('[name=testo]').val() }),
dataType: "XML",
success : function(xml) { $('label').find('span').hide();}
complete: function(xhr) { callback(xhr.status); }
});
}
getUrlStatus('http://www.website', function(status) {
if (status == 200) {
e.preventDefault();
}
});
});