title: How can I change the browser user agent with javascript/html?
body: <p>I have an app running in IE7. However, one of the analytics app I use just updated and requires minimum IE8. Is there a javascript/html way to spoof the User Agent in IE7 to be detected as IE8? </p>
  
  <p>This is what I am doing so far but it is not working in IE7</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=8" /&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;script type="text/javascript"&gt;
      navigator.__defineGetter__('userAgent', function() {
      return 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US)';
      });
      alert(navigator.userAgent);
    &lt;/script&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to change the User Agent of IE7 to IE8 through javascript/html only. I don't have access to the windows registry.</p>
  
  <p>Any help? Thanks!</p>