title: Error: uncaught exception: [Exception..."String contains an...."
body: <p>I am running the following javascript:</p>
  
  <pre><code>$('img').each(
      function(){
          var w = parseInt(this.width);
              alert(w);
              alert(this.src);
          if(w &gt; 300){
  
              var percent = parseInt((w/666)*100);
              $(this).removeAttr('width height').css('width',percent + "%");
  
          }
  });
  </code></pre>
  
  <p>And I am getting the following error:</p>
  
  <blockquote>
    <p>Error: uncaught exception: [Exception... "String contains an invalid
    character"  code: "5" nsresult: "0x80530005
    (NS_ERROR_DOM_INVALID_CHARACTER_ERR)"  location:
    "http://code.jquery.com/jquery-1.6.4.min.js Line: 2"]</p>
  </blockquote>
  
  <p>I'm having trouble actually trying to track this one down as it isn't very descriptive of the problem or the source of the problem. Can anyone shed some light on the problem?</p>
  
  <p>Thanks</p>