web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Basic AJAX

Andre Margono Profile Picture Andre Margono 2,602

I found this function to load a document via ajax. It enables people to do web task without reloading the page

function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
xmlhttp.open(“GET”,url,false);
xmlhttp.send(null);
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”);
xmlhttp.open(“GET”,url,false);
// Do not send null for ActiveX
xmlhttp.send();
}
document.getElementById(‘test’).innerHTML=xmlhttp.responseText;
}


This was originally posted here.

Comments

*This post is locked for comments