Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IE errors on page with AHAH

    I have some issues when making a simple photogallery. Works just fine in opera, safari, firefox, but not IE.

    In IE, it simply returns the callMessage, "Loading data...", and then never loads the data. At the bottom of the IE browser it says "errors on page".

    Here is the main javascript:

    Code:
    function callAHAH(url, pageElement, callMessage) {
    	document.getElementById(pageElement).innerHTML = callMessage;
    	try {
    	req = new XMLHttpRequest();
    	} catch(e) {
    	  try {
    	  req = new ActiveXObject("Msxml2.XMLHTTP");
    	  } catch(e) {
    	    try {
    	    req = new ActiveXObject("Microsoft.XMLHTTP");
    	    } catch(e) {
    	      req = false;
    	    }
    	  }
    	}
    	req.onreadystatechange = function() {responseAHAH(pageElement);};
    	    req.open("GET", url, true);
    	    req.send(null);
    }
    
    function responseAHAH(pageElement) {
    	var output = '';
    	if (req.readyState == 4) {
    	   if ( req.status == 200) {
    	      output = req.responseText;
    	      document.getElementById(pageElement).innerHTML = output;
    	   }
    	}
    }
    Here is where I call the function:

    Code:
    <a href="#" onclick = "callAHAH('/images.php?image=182', 'pic_div', 'Loading Data...')" > LINK HERE </a>

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    When you click on that text that says "Error on the page" what does the error dialog say?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •