1function httpGet(theUrl) {
2 var xmlHttp = new XMLHttpRequest();
3 xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
4 xmlHttp.send( null );
5 return xmlHttp.responseText;
6}
1function httpGet(theUrl)
2{
3 var xmlHttp = new XMLHttpRequest();
4 xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
5 xmlHttp.send( null );
6 return xmlHttp.responseText;
7}
8
1function httpGetAsync(url, callback) {
2 var xmlHttp = new XMLHttpRequest();
3 xmlHttp.onreadystatechange = function() {
4 if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
5 callback(xmlHttp.responseText);
6 }
7 xmlHttp.open("GET", url, true); // true for asynchronous
8 xmlHttp.send(null);
9}