title: Why document.createEvent is not supported with webbrowser on IE9+ and how to fix it?
body: <p>I'm using Windows 8, Internet Explorer 10, Visual Studio 2013  </p>
  
  <p>Here is javascript code :</p>
  
  <pre><code>function simulate(element, eventName)
  {
      var options = extend(defaultOptions, arguments[2] || {});
      var oEvent, eventType = null;
  
      for (var name in eventMatchers)
      {
          if (eventMatchers[name].test(eventName)) { eventType = name; break; }
      }
  
      if (!eventType)
          throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported');
  
      if (true || document.createEvent) // temporary it's always true to check IE
      {
          oEvent = document.createEvent(eventType);
          if (eventType == 'HTMLEvents')
          {
              oEvent.initEvent(eventName, options.bubbles, options.cancelable);
          }
          else
          {
              oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView,
              options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
              options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element);
          }
          element.dispatchEvent(oEvent);
      }
      else
      {
          options.clientX = options.pointerX;
          options.clientY = options.pointerY;
          var evt = document.createEventObject();
          oEvent = extend(evt, options);
          element.fireEvent('on' + eventName, oEvent);
      }
      return element;
  }
  
  function extend(destination, source) {
      for (var property in source)
        destination[property] = source[property];
      return destination;
  }
  
  var eventMatchers = {
      'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
      'MouseEvents': /^(?:click|dblclick|mouse(?:down|up|over|move|out))$/
  }
  var defaultOptions = {
      pointerX: 0,
      pointerY: 0,
      button: 0,
      ctrlKey: false,
      altKey: false,
      shiftKey: false,
      metaKey: false,
      bubbles: true,
      cancelable: true
  };
  </code></pre>
  
  <p>My HTML :</p>
  
  <pre><code>&lt;a href="http://google.com" id="rrx"  &gt; google &lt;/a&gt;
  </code></pre>
  
  <p>And here is my javascript code that calls simulate :</p>
  
  <pre><code>simulate(document.getElementById('rrx'), "click"); 
  </code></pre>
  
  <p>The problem is that I'm not redirected to google web page because IE throws a exception with message that <code>document.createEvent</code> is not supported.
  As far as I know <code>document.createEvent</code> should be supported with IE9+.</p>