var form = document.querySelector('form');
var data = new FormData(form);
var req = new XMLHttpRequest();
req.open('POST', 'http://example.com/');
req.send(data);
$.ajax({
type: "POST",
url: 'http://example.com/',
data: $('form').serialize()
});