Here is my simple ajax code…..

 

var req = new XMLHttpRequest();
req.open(”GET”, “test.html”,true);
req.onreadystatechange = function () {
document.getElementById(’divTxt’).innerHTML = “Contents : ” + req.responseText;
}
req.send(null);

HTML Source - test.html

apple
orange
pencil
box
bottle
computer
cat
dog
fox
windows
linux
unix
freebsd
blah

This code is compatible with Mozilla based browsers only. Eg: Firefox for windows
VN:F [1.1.6_502]Rating: 2.0/5 (1 vote cast)