1//set your ajax url here
2//$url =
3$(document).on('submit', '#form', function(e){
4 e.preventDefault();
5 $.ajax({
6 type: 'POST',
7 url: $url,
8 data: new FormData(this),
9 dataType: 'json',
10 contentType: false,
11 processData:false,//this is a must
12 success: function(response){
13 //statements on success
14 }
15 });
16 });