title: javascript not being called
body: <p>I have the following javascript functions, which when in a standalone file, will be called correctly from a page.</p>
  
  <pre><code>function deleteItem(layer, url) {
      var xmlHttp=GetXmlHttpObject();
      if(xmlHttp==null) {
          alert("Your browser is not supported?");
      }
      xmlHttp.onreadystatechange = function() {
          if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
              if(xmlHttp.responseText == 'result=true') {
                  var row = document.getElementById(layer);
                  row.parentNode.removeChild(row);
              }
              document.getElementById(layer).innerHTML=xmlHttp.responseText;
          } else if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") {
              document.getElementById(layer).innerHTML="loading";
          }
      }
      xmlHttp.open("GET",url,true);
      xmlHttp.send(null);
  }
  function deleteRec(layer, pk) {
      url = "get_records.php?cmd=deleterec&amp;pk="+pk+"&amp;sid="+Math.random();
      if (confirm("Confirm Delete?")) {
          deleteItem(layer, url);
      }
  }
  function GetXmlHttpObject() {
      var xmlHttp=null;
      try {
          xmlHttp=new XMLHttpRequest();
      }
      catch (e) {
          try {
              xmlHttp =new ActiveXObject("Microsoft.XMLHTTP");
          }
          catch (e) {
          }
      }
      return xmlHttp;
  }
  </code></pre>
  
  <p>It is called like so:</p>
  
  <pre><code> echo '&lt;td&gt;&lt;a href="#" onclick="deleteRec(\'article_' . $pk .'\', \'' . $pk . '\')"&gt;DELETE&lt;/a&gt;&lt;/td&gt;' . "\n"; 
  </code></pre>
  
  <p>This displays the confirm dialog, and will delete the page if OK is clicked, as it should.</p>
  
  <p>However.</p>
  
  <p>When my other necessary functions are placed in the js file, nothing will happen.</p>
  
  <pre><code>function update(layer, url) {
      var xmlHttp=GetXmlHttpObject();
      if(xmlHttp==null) {
          alert("Your browser is not supported?");
      }
      xmlHttp.onreadystatechange = function() {
          if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
              document.getElementById(layer).innerHTML=xmlHttp.responseText;
          } else if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") {
              document.getElementById(layer).innerHTML="loading";
          }
      }
      xmlHttp.open("GET",url,true);
      xmlHttp.send(null);
  }
  function updateByPk(layer, pk) {
      url = "get_auction.php?cmd=GetAuctionData&amp;pk="+pk+"&amp;sid="+Math.random();
      update(layer, url);
  }
  function updateByQuery(layer, query) {
      url = "get_records.php?cmd=GetRecordSet&amp;query="+query+"&amp;sid="+Math.random();
      update(layer, url);
  }
  function updateByPage(layer, query, pg) {
      url = "get_records.php?cmd=GetRecordSet&amp;query="+query+"&amp;pg="+pg+"&amp;sid="+Math.random();
      update(layer, url);
  }
  function deleteItem(layer, url) {
      var xmlHttp=GetXmlHttpObject();
      if(xmlHttp==null) {
          alert("Your browser is not supported?");
      }
      xmlHttp.onreadystatechange = function() {
          if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
              if(xmlHttp.responseText == 'result=true') {
                  var row = document.getElementById(layer);
                  row.parentNode.removeChild(row);
              }
              document.getElementById(layer).innerHTML=xmlHttp.responseText;
          } else if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading") {
              document.getElementById(layer).innerHTML="loading";
          }
      }
      xmlHttp.open("GET",url,true);
      xmlHttp.send(null);
  }
  function deleteRec(layer, pk) {
      url = "get_records.php?cmd=deleterec&amp;pk="+pk+"&amp;sid="+Math.random();
      if (confirm("Confirm Delete?")) {
          deleteItem(layer, url);
      }
  }
  function GetXmlHttpObject() {
      var xmlHttp=null;
      try {
          xmlHttp=new XMLHttpRequest();
      }
      catch (e) {
          try {
              xmlHttp =new ActiveXObject("Microsoft.XMLHTTP");
  
          }
          catch (e) {
          }
      }
      return xmlHttp;
  }
  function makewindows(html) {
      child1 = window.open ("about:blank");
      child1.document.write(html);
      child1.document.close();
  }
  </code></pre>
  
  <p>There does not seem to be anything wrong with the JavaScript itself, so I am wondering if something is being canceled out somehow. Even when changing deleterec() to a simple alert nothing happens.</p>