Теперь по основному вопросу, почему так не работает?
Должно вызваться 4 раза, а не 1, и this не работает...
function GetHttpRequest(href, id)
{
xhr = new XMLHttpRequest()
xhr.withCredentials = true
xhr.onreadystatechange = ProcessRequestChange(id)
xhr.open('GET', href, true)
xhr.send(null)
}
function ProcessRequestChange(id)
{
alert(id + ' ' + this.readyState)
}
GetHttpRequest('http://javascript.ru', 24)