Всё!
function getVars() {
var request = new XMLHttpRequest(),
vars;
request.open("POST", "file.php", false);
request.onreadystatechange = function () {
if (request.readyState === 4 && request.status === 200) {
var response = JSON.parse(request.responseText);
vars = response;
}
};
request.send();
return vars;
}