Forum Moderators: open
heres my code:
<script type="text/javascript">
var req;
var language;
var section;
var subsection;
var theGet;
function ajaxLoadContent( language, section, subsection )
{
theGet = './process.php?language=' + language + '§ion=' + section + '&subsection=' + subsection;
id = section + 'Content';
// branch for native XMLHttpRequest object
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
}
// branch for activeX
else if (window.ActiveXObject)
{
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.onreadystatechange = processReqChange;
req.open("GET", theGet, true);
req.send( null );
}
function processReqChange()
{
// only if req shows "complete"
if (req.readyState == 4)
{
// only if "OK"
if (req.status == 200)
{
var node = document.createTextNode( req.responseXML );
document.getElementById( id ).appendChild( node );
}
else
{
alert ("There was a problem retrieving the XML data:\n" + req.statusText);
}
}
oldIdMarker = id;
}
</script>
thx!