dcsimg
Pre/Post processing Apon Return
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Wata_Gal
Posted On:   Friday, May 26, 2006 05:31 PM

Bare with me I'm new at this. I have Ajax working, I can retrieve a HTML page and pass it to the innerHTML of an div element on my current page. I've noticed that it does no post processing in the retrieved HTML page. As in the body's (JS) onload event. Is there a way around this? So I moved on to PHP. I have Apache/PHP working just fine on localhost here (I can call a php page directly and it works fine). But when I use AJAX to call the same PHP page, the PHP code is ignored. Do I need to setup Apache or PHP to recognize AJAX? Here's my AJAX code: function newAjaxConnection(){ var oAjax = false; try {oAjax = new ActiveXObject("Msxml2.XMLHTTP");}    More>>

Bare with me I'm new at this. I have Ajax working, I can retrieve a HTML page and pass it to the innerHTML of an div element on my current page.

I've noticed that it does no post processing in the retrieved HTML page. As in the body's (JS) onload event.

Is there a way around this?

So I moved on to PHP. I have Apache/PHP working just fine on localhost here (I can call a php page directly and it works fine).

But when I use AJAX to call the same PHP page, the PHP code is ignored. Do I need to setup Apache or PHP to recognize AJAX?



Here's my AJAX code:


			
function newAjaxConnection(){
var oAjax = false;
try {oAjax = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {
try {oAjax = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e2) {oAjax = false;}
}

if (!oAjax && typeof XMLHttpRequest != 'undefined'){
oAjax = new XMLHttpRequest();
if (oAjax.overrideMimeType) oAjax.overrideMimeType('text/xml');
}

if (!oAjax ) alert("Ajax Error: Initializing XMLHttpRequest Failed");
else return oAjax
}


function ajaxInclude(url,div) {
var o = document.getElementById(div);

oAjax = newAjaxConnection();
oAjax.open('GET', url, false); // Synchronously
oAjax.send(null);

o.style.display = "block";
o.innerHTML = oAjax.responseText;
}

Why isn't the PHP being processed by the Apache server? Or what is happening?

Thanks, WG

   <<Less
About | Sitemap | Contact