$.ajax({
url: 'index.php',
type: 'POST',
data: somedata,
async: false,
success: function(res) {
console.log(res);
}
});