title: Javascript 'Element' is undefined in ie but works fine in chrome and firefox
body: <p>I've got some javascript that runs correctly in firefox and chrome but causes ie to die with "Error: 'foo' is undefined (line foo.onclick = false in below code).</p>
  
  <p>I'm trying disable an onlick function for an image while the page reloads.  Code is below:</p>
  
  <pre><code>function UpdateQueryAndRefresh(queryName, queryValue) {
      var escapedQueryName = encodeURIComponent(queryName);
      var escapedQueryValue = encodeURIComponent(queryValue);
      var upd_url = UpdateQueryStringParameter(document.URL, escapedQueryName, escapedQueryValue);
  
      if (upd_url.toUpperCase() != document.URL.toUpperCase()) {
          // Disable save button during refresh
          // Update current scale parameter also
          upd_url = UpdateQueryStringParameter(upd_url, "Scale", m_scale.toString());
  
  
          foo.onclick = false;
  
          window.location.href = upd_url;
      }
  }
  </code></pre>
  
  <p>I've read that if something works in other browsers but not ie, that my header is likely wrong, but I checked the headers and they seem fine.  When I use the ie built in script debugger I can see that for whatever reason the foo image is undefined.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>@JamieBarker
  So I'm somewhat new to this language...  Foo is an image that's defined in the body of the page as an image. Here it is:</p>
  
  <pre><code>&lt;img id="foo" src="images/image.png" alt="Show"  height="10" width="18" align="absmiddle" onclick="function()" /&gt;
  </code></pre>
  
  <p>Is there a reason that I can't see this in ie but I can in firefox and chrome?</p>