title: $(document).ready(function(){}); fails on IE9
body: <p>I'm using a single js file for multiple php pages. At the end of each php I create a javascript variable to identify it, like this:</p>
  
  <pre><code>&lt;div&gt;    
  .
  .
  .
  &lt;/div&gt;
  
  &lt;script&gt;
  var idp = 1;
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then in my js file I have:</p>
  
  <pre><code>$(document).ready(function() {
      .
      .
      .
      if (idp == 1) {
         FunctionWithTheCodeForPage1();
      }
      if (idp == 2) {
         FunctionWithTheCodeForPage2();
      }
  });
  </code></pre>
  
  <p>It works fine on Chrome and on Firefox but in IE9 sometimes it does not seems to get the value of idp variable and sometimes it does not execute some jquery code I have before the "if" statements, seems like the problem is the $(document).ready(); because I have set the FunctionWithTheCodeForPage1(); directly inside the php for page 1 and it works, but the rest of the code inside $(document).ready(); does not.</p>
  
  <p>This are the libreries I'm using:</p>
  
  <pre><code>&lt;script type='text/javascript' src="Scripts/Popcalendar.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src='Scripts/jquery-latest.js'&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src='Scripts/jquery.lightbox_me.js'&gt;&lt;/script&gt;
  &lt;script type='text/javascript' src='Scripts/MyJS.js'&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This problem does not happens all the time, sometimes the page loads right and sometimes gets this error, but mostly with the error. 
  Are there compatibility problems with IE9? What am I missing? Thanks</p>