Question: I'm writing an html file with javascript to create an XMLHttpRequest, however, I'm not getting the results I need. 

```js
function loadXMLDoc(){
    var xmlhttp;
    if(windows.XMLHttpRequest){ 
        //code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp = new XMLHttpRequest();
    } else {
        //code for IE6, IE5
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
            document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
        }
    }

    xmlhttp.open("GET", "ajax_info.txt", true);
    xmlhttp.send();
}

```

I don't know if the server I'm using has anything to do with this (I'm using wampserver). I have my files in the www directory, but still no results.
What's the problem?

Answer: 
In the second line of your function you have the ability detection code

```
if(windows.XMLHttpRequest){
    ....
}

```

that is misspelled, it should be

```
if(window.XMLHttpRequest){ 
    ....
}

```

other than that it should be fine

Just ran a test on my local machine and everything works just fine. Try to

* clear the browser's cache
* make sure the reqested file actualy exists and it's in the root location of the domain/subdomain you are running the script from (which is not necessarily the same location as the javascript file containing the code)
* check console log for any error if it still doesn't work
I suggest you to use JQuery, it requires less coding.

```
$.ajax({
    url: "your url", 
    type: "GET",
    data: "the data you are sending",
    dataType: "the type of data you want to be returned",
    success: function(data) {
        document.getElementById("myDiv").innerHTML = data;
    }
});

```

[`jQuery.ajax` API](http://api.jquery.com/jQuery.ajax/)