I am using AHAH to echo HTML lists to a div with PHP. The AHAH portion is working perfectly. The problem, is that even though the HTML is echoed and displayed, when I view the source of the page there is no HTML there. Typically with just PHP you would see the echoed data so that leads me to believe the AHAH script is doing this. I believe this is causing an issue with another javascript I am using to expand and collapse the lists, because the second javascript does not see the HTML. I don't know very much about javascript, but I need to find a way to use the scripts together. I can post whatever code is needed. I appreciate any help I can get.

The AHAH script:

function callAHAH(url, pageElement, callMessage, errorMessage) {
     document.getElementById(pageElement).innerHTML = callMessage;
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */
         } catch (E) {
          req = false;
         } 
       } 
     }
     req.onreadystatechange = function() {responseAHAH(pageElement, errorMessage);};
     req.open("GET",url,true);
     req.send(null);
  }

function responseAHAH(pageElement, errorMessage) {
   var output = '';
   if(req.readyState == 4) {
      if(req.status == 200) {
         output = req.responseText;
         document.getElementById(pageElement).innerHTML = output;
         } else {
         document.getElementById(pageElement).innerHTML = errorMessage+"\n"+output;
         }
      }
  }

OK, no takers so far. Ultimately, here is what I am trying to do and what I need help with. The script posted above uses AJAX, which I understand is supported here. My javascript toggle script uses JQuery. I am looking for a way to integrate them. Can someone help me please?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.