scott212 Posted January 26, 2007 Share Posted January 26, 2007 Is there a way (besides RegEx) to determine the response type from an AJAX request? Here's the code that I'm trying:[code]if (xmlHttp.readyState==4) { // show results var respObj = eval('('+xmlHttp.responseText+')'); if (respObj.message) { document.getElementById('ax_search_main').innerHTML = "<div class=\"createProfile_labels\">"+respObj.message+"</div>"; ax_process(); } else { document.getElementById('ax_search_main').innerHTML = xmlHttp.responseText; }}[/code] Link to comment https://forums.phpfreaks.com/topic/35759-solved-determining-ajax-response-type-json-or-html/ Share on other sites More sharing options...
scott212 Posted January 26, 2007 Author Share Posted January 26, 2007 I figured it out, ended up passing an id in JSON and doing a js search for it Link to comment https://forums.phpfreaks.com/topic/35759-solved-determining-ajax-response-type-json-or-html/#findComment-169505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.