title: javascript isn't working in IE unless debugger is running
body: <p>the following code works perfectly in FireFox 7, but when pulling up the same page in IE 9, the jQuery functions (hide and show) don't work.  However if you open debugger in IE and refresh, everything works fine.  It's like the jQuery code won't work unless debugger is running and you refresh the page (or start IE with debugger on), which makes it difficult to debug obviously.  </p>
  
  <p>all the CSS and scripting are included for this sample.  If I need to include any other information please let me know.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;!--&lt;link href="_css/main.css" rel="stylesheet" type="text/css" /&gt;--&gt;
  
  
   &lt;style&gt;    
  
  html, body {
      margin: 0px;
      padding: 0px;
  }
  
  #wrapper {
      width:1000px;
      margin-left: auto;
      margin-right: auto;
      height: 100%;
  }
  #sidebar {
      width: 100px;
      height:100%;
      float: left;
      background-color: #FF0;
  }
  
  #maincontent {
      float: left;
      width: 400px;
      height:100%;
      ;
      background: #c1d8b9;
  }
  #right {
      width: 500px;
      background-color: #0F3;
      float: right;
      height: 100%;
  }
  
  
  
  body {
      background-color: white;
  }
  
  
  ul
  {
      list-style-type: none;
  }
  &lt;/style&gt; 
   &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  
  
  &lt;body&gt;
  &lt;div id="wrapper"&gt;
    &lt;div id="sidebar"&gt; Sidebar
      &lt;ul &gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div id="maincontent"&gt; Main content
        &lt;button id="hidr"&gt;Hide&lt;/button&gt;
    &lt;button id="showr"&gt;Show&lt;/button&gt;
      &lt;ul id="listMiddle"&gt;
        &lt;li id="li1"&gt;TEST1&lt;/li&gt;
        &lt;li id="li2"&gt;TEST2&lt;/li&gt;
        &lt;li id="li3"&gt;TEST3&lt;/li&gt;
        &lt;li id="li4"&gt;TEST4&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;div id="right"&gt; Right
      &lt;ul id="listRight"&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;    
  var arryLIs = document.getElementsByTagName('li');
  var middleUL = document.getElementById('listMiddle');
  var rightUL = document.getElementById('listRight');
  var arrymiddleLIs = middleUL.getElementsByTagName('li');
  var arryrightLIs = rightUL.getElementsByTagName('li');
  
  
  for (var i=0; i&lt;arryLIs.length; i++){
      arryLIs[i].onclick = moveright; 
      //console.log(arryLIs[i].innerHTML);
  
  }
  
  
  console.log(arrymiddleLIs);
  console.log(middleUL);
  
  var goBefore=null;
  
  function moveright() {
      var goBefore=null;
      goBefore=findSortRight(this);
      document.getElementById('listRight').insertBefore(this,goBefore);
      this.onclick = moveleft;
      //console.log(arrymiddleLIs);
      //console.log(arryrightLIs);
  
  }
  
  function moveleft() {
      document.getElementById('listMiddle').appendChild(this);
      this.onclick = moveright;   
      console.log(arrymiddleLIs);
      console.log(arryrightLIs);  
  }
  
  function findSortRight(newElement){
      var goBefore=null;
      for (var r=0; r&lt;arryrightLIs.length; r++){
          //console.log(newElement.innerHTML&lt;=arryrightLIs[r].innerHTML);
          if (newElement.innerHTML&lt;=arryrightLIs[r].innerHTML) {
              //console.log(arryrightLIs[r]);
              goBefore=arryrightLIs[r];
              break;
          }
      }
  //  console.log(goBefore.innerHTML);
      return goBefore;
  
  }
  
  
  
      $("#hidr").click(function () {
        $("li").hide();
      });
  
      $("#showr").click(function () {
        $("li").show();
      });
  
  
  &lt;/script&gt; 
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>