title: "Object doesn't support this property or method IE" error in Javascript possibly from using hasOwnProperty?
body: <p>I'm getting this error in IE8 and IE7 for some reason. I'm looping through all keys within my object and it keeps telling me <code>Object doesn't support this property or method</code> on this on:</p>
  
  <pre><code>var inVal = $(inType + "#" + inName).val().trim();
  </code></pre>
  
  <p>The entire block is below:</p>
  
  <pre><code>for (var key in inputs) { // find all keys "brand", "name", etc. in our inputs object
          var errors = false;
  
          if (inputs.hasOwnProperty(key)) { // focus on our obj. not all others on page 
              var inType = inputs[key].inputType;
              var inName = inputs[key].inputName;
              var inVal = $(inType + "#" + inName).val().trim(); // construct input field
  
              if (inVal == '' || inVal == null) {
                  errors = true;
  
                  $('#' + inName + '-error').html('');
                  $('#' + inName + '-error').hide().fadeIn().html(inputs[key].errorMsg);
                  $(inType + '#' + inName).focus();
                  $('#modal-loadable-inner').scrollTop(inputs[key].scrollTop);
  
                  return;
              } else { // user corrected error
                  errors = false;
                  $('#' + inName + '-error').html(''); // remove error txt
              }
          }
      }
  </code></pre>
  
  <p>Someone posted this on Doug Crockford's jslint boards and he responded with:</p>
  
  <blockquote>
    <p>for (key in object) {
        if (Object.prototype.hasOwnProperty.call(object, key)) {
        ...
        }
        }</p>
    
    <p>hasOwnProperty should have been an operator, not a method, because
    being a
        method, it is prone to these sorts of problems. But it is what it is, so you
        have to work around that.</p>
  </blockquote>
  
  <p>Works fine in Chrome, FF, Safari, Opera, etc.. as usual. Any idea on a workaround?</p>