I want my page to execute the same function 3 times, calling for 3 different things each time.

The code is currently

```
 <script>
 ajaxGet('/goget.php?name='+edit.dep.value, 'dep_result');
 ajaxGet('/goget.php?name='+edit.arr.value, 'arr_result');
 ajaxGet('/goget.php?type='+edit.reg.value, 'reg_result');
 </script>

```

But it only executes the last call. Why?

Javascript:

```
var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {

XMLHttpRequestObject = new XMLHttpRequest();

} else if (window.ActiveXObject) {

XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}

function ajaxGet(ajaxLoadData, changeToID) {

if(XMLHttpRequestObject) {

    var obj = document.getElementById(changeToID);
    XMLHttpRequestObject.open("GET", ajaxLoadData);
    XMLHttpRequestObject.onreadystatechange = function() {

    if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status ==     200) {

        obj.innerHTML = XMLHttpRequestObject.responseText;

    }
}

    XMLHttpRequestObject.send(null);

}
}

```