title: Object Expected IE8 JS/JQuery issue IE8
body: <p>This is my first post on here though I browse through SO a lot for answers.  I'm running into a problem where IE8 will keep throwing "Object Expected" error.  I used IE8's Developer tools and it points to "mymh.js" file</p>
  
  <pre><code>    &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="/MyMHome/javascript/mymh.js"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>mymh.js file only has the following code</p>
  
  <pre><code>    $(document).ready(function() {          
  
          $('#hNumber').focus();
  
          $('#ddlDir').change(function () {
  
              var selVal = $('#ddlDir').val();
  
               if (selVal == 'N' || selVal == 'S' || selVal == 'E' || selVal == 'W'){
  
               $.getJSON('/MyMHome/DimeServlet?strDir='+$('#ddlDir option:selected').val(), function(data) {
  
                      $('#ddlSt')
                      .find('option')
                      .remove()
                      .end()
  
                  $.each(data, function(i,field){
                      var name = field;
                      $('#ddlSt')
  
                      .append('&lt;option value= ' + '"' + name + '"' + '&gt;' + name + '&lt;/option&gt;');   
                      });
                  });
  
                  $('#ddlSt').focus();    
               }else{ 
  
                      $('#ddlSt')
                      .find('option')
                      .remove()
                      .end()
                      .append('&lt;OPTION selected value=""&gt;Choose a direction first&lt;/OPTION&gt;');
  
                  }                   
          })
          .trigger('change');             
  
          $('#reset').click(function(){
               $('#ddlSt')
              .find('option')
              .remove()
              .end()
              .append('&lt;OPTION selected value=""&gt;Choose a direction first&lt;/OPTION&gt;'); 
               $('#hNumber').focus();                
          });
  
          $('#hNumber').bind('keyup', function() {
              if($('#hNumber').val().length == 5){
                      $('#ddlDir').focus();
              }
          });             
  
          $('#submitQuery').click(function(){
              var houseNumber = $('#hNumber').val();
              if(houseNumber.replace(/\s+/g, '').length == 0){
                  alert('Please enter a house number.');
                  $('#hNumber').focus();  
                  return false;
              }else if( (!$.isNumeric(houseNumber)) || houseNumber.indexOf('-') &gt; -1 || houseNumber.indexOf('.') &gt; -1){
                  alert('Please enter numbers only. You will be prompted later, if the address requires a suffix.');
                  $('#hNumber').focus();  
                  return false;
              }else if(houseNumber &lt; 100 || houseNumber &gt; 12999){
                  alert('Please enter a house number between 100 and 12999');
                  $('#hNumber').focus();
                  return false;
              }else if($('#ddlDir option:selected').val() == 'none'){
                  alert('Please select a street direction.');
                  $('#ddlDir').focus();
                  return false;
              }       
          });         
  
          $('form').keypress(function(e) {
                if (e.keyCode == '13') {
                   e.preventDefault();
                   if($('#ddlSt').is(":focus")){
                       $('#submitQuery').trigger('click');
                   }
                   else{
                       return false;
                   }
                 }
          });
  });
  </code></pre>
  
  <p>The error points to the <code>&lt;script ...  mymh.js&gt;&lt;/script&gt;</code> but in the debugger it points to <code>$document.ready(function() {</code></p>
  
  <p>Anyone see anything wrong as to why IE8 would keep throwing that error?</p>