Magic Light, не вижу проблем в коде.
Попробуйте отказаться от устаревшего кода в пользу:
function ajaxRequest(address, params, functionName) {
fetch(address, {
method: 'POST',
body: params,
})
.then((response) => response.text())
.then((text) => functionName(text))
.catch((error) => console.error(error))
}