Fixed event creation for IE

Currently IE only supports the legacy way of creating events (ie. createEvent / initEvent), and will throw an exception if the new standards (using the Event constructor) are used. This patch catches this exception to try the legacy method if the new one does not work.