SerAl,
var xhr = new XMLHttpRequest();
xhr.open('POST', 'upload.php');
xhr.onload = function() {
if (this.status == 200) {
alert('Uploaded!');
} else {
alert('Server error!');
}
};
xhr.onerror = function() {
alert('Network error!');
};
xhr.send(new FormData(document.forms.upload));