Jump to content

page preloader but no loading part ha


Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.