static/javascript/parse.js
function getResults( form, url, callback ){
    var formData = new FormData( form );
    var request = new XMLHttpRequest();
    request.open("POST", url);
    request.send(formData);
    
    request.onload = function(e) {
     if (request.status == 200) {
            callback(null, JSON.parse(request.responseText));
        } else {
            callback("Error " + request.status + ' - ' + request.responseText, null);
        }
    };
}
function getResults( form, url, callback ){
    var formData = new FormData( form );
    var request = new XMLHttpRequest();
    request.open("POST", url);
    request.send(formData);
    
    request.onload = function(e) {
     if (request.status == 200) {
            callback(null, JSON.parse(request.responseText));
        } else {
            callback("Error " + request.status + ' - ' + request.responseText, null);
        }
    };
}
function getResults ( form , url , callback ) { var formData = new FormData ( form ) ; var request = new XMLHttpRequest ( ) ; request . open ( "POST" , url ) ; request . send ( formData ) ; request . onload = function ( e ) { if ( request . status == 200 ) { callback ( null , JSON . parse ( request . responseText ) ) ; } else { callback ( "Error " + request . status + ' - ' + request . responseText , null ) ; } } ; }
post form and returns JSON
post form and returns JSON