Ciarán Mc Cann
New Member
hey every1, just one small question I have this AJAX script (which I think some1 here wrote a while back...not sure) but anyway, yea it handles $_GET, but I need it to work with $_POST, I have tryed to modify it myself but cant get it to work. any1 know how?
PHP:
function ewd_getcontent(url, containerid){
var xmlhttp_obj = false;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
xmlhttp_obj = new XMLHttpRequest();
else if (window.ActiveXObject){ // if IE
try {
xmlhttp_obj = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
try{
xmlhttp_obj = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){}
}
}
else
return false;
document.getElementById(containerid).innerHTML="<img src='images/loading.gif' /> <b>Loading Data...</b>" ;
xmlhttp_obj.onreadystatechange=function(){
ewd_loadpage(xmlhttp_obj, containerid);
}
xmlhttp_obj.open('GET', url, true);
xmlhttp_obj.send(null);
}
function ewd_loadpage(xmlhttp_obj, containerid){
if ( xmlhttp_obj.readyState == 4 && xmlhttp_obj.status==200 )
document.getElementById(containerid).innerHTML=xmlhttp_obj.responseText;
}