Hello,
I need help with this code because for some reason I don't get the data back It is probably something that got mixed up, because I never used xml with an ajaxcall
Could someone check if they see something going wrong here
function updateGebruikersonline(){
//voor het fade effect
gebruikerslijst.hide();
loading2.fadeIn(2000, function () {
//stuur de post variabelen naar livetabs.php
$.ajax({
type: "POST", url: "/includes/livetabs.php", data: "actie=gebruikersonline",
complete: function(xml){
loading2.fadeOut(2000);
gebruikerstoevoegen(xml);
}
,error: function(XMLHttpRequest, textStatus, errorThrown) {
if(textStatus == 'timeout') {
berichtlijst.html(fout).fadeIn(2000);
}else if (textStatus == 'error'){
berichtlijst.html(fout).fadeIn(2000);
}
}
});//EINDE ajax
});//EINDE callback loading
}
Edited: because I found the answer
I completely overlooked that I had to use this line in the php file, so that the browser will recognize it as xml.
//php
header('Content-Type: application/xml; charset=ISO-8859-1');
thanks, Richard