miracle_potential Posted June 18, 2008 Share Posted June 18, 2008 I have a page with a PHP class attatched to it but I cant work out how to get the Ajax script I downloaded to load it then show it. http://new.noirorchidemporium.co.uk/ click on browse and you'll see it. just keeps loading and doesnt do anything. Heres the Ajax code // Get the HTTP Object function getHTTPObject(){ if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } } // Change the value of the outputText field function setOutput(){ if(httpObject.readyState == 4){ document.getElementById('myBody').innerHTML = httpObject.responseText; } } // Implement business logic function loadSite(){ httpObject = getHTTPObject(); if (httpObject != null) { httpObject.open("GET", "content.php", true); httpObject.send(null); httpObject.onreadystatechange = setOutput; } } var httpObject = null; And heres the Iframe that has the loader <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script language="javascript" type="text/javascript" src="../../includes/max.js"></script> <link href="../../includes/other_styles.css" rel="stylesheet" type="text/css" /> </head> <body onload="loadSite();" id="productspage"> <div align="center" id="loader"><img src="../../images/loading.gif" border="0" /></div> </body> </html> Its supposed to load my PHP page but it wont even when I just put something in it like <? echo "hello world"; ?> I'm not an Ajax or JS buff so any help would be awesome thanks!! Link to comment https://forums.phpfreaks.com/topic/110827-page-preloader-but-no-loading-part-ha/ Share on other sites More sharing options...
miracle_potential Posted June 19, 2008 Author Share Posted June 19, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/110827-page-preloader-but-no-loading-part-ha/#findComment-569008 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.