I am sending an ajax call via the following:
var response = sendViaAjax(str,'Session/delete_From_Session_AJAX.php') ;
alert('response:|'+response+'|') ;
if(response == 'complete') {//returns complete if the table was not to be rewritten
el = this ;
while(el.tagName !== 'TR'){
el = el.parentNode ;
alert(el.tagName) ;
}
removeChildren(el) ;
removeElement(el) ;
}else if(response!= 'complete') {
alert(response+' is not equal to complete') ;
parseHTMLStr(response,window.cur_tbl,1,0,0) ;
}
The relevant code from delete_Session… is
if( isset($_POST['REWRITE']) ) {
include("return_Tabular_Data.php") ;
}else{
echo 'complete' ;
}
The alert I am getting from the formatted string is:
complete
is not equal to complete
Something must be added but I cannot find where. I use this function extensively and have never had a similar issue.
The only place I modify the response in sendViaAjax is
var RESPONSE = xmlhttp.responseText ;
RESPONSE = RESPONSE.replace(/^\s+/, '');
return RESPONSE ;
Do you have whitespace after your closing
?>tag on the server-side?Ideally, when using AJAX you want to
exitspecifically when you want output to end. Or you can just not put?>, since it’s optional at the end of the file.