jrburke/requirejs — Issue #187: [Suggestion] Do not use attachEvent to determine interactive mode
Author: normanzb
Created: 2012-02-21 08:45:03+00:00
State: open

some libraries, such as prototype.js or sscompat.js (which from script sharp) will add ms compatible attachEvent() function to HTMLElement.prototype, which might cause module failed to load in certain situation.

my suggestion is to determine the interactive mode by accessing script element's readyState, just like what curl.js did in their loader.

alternatively, try to delete the attachEvent from HTMLElement.prototype, if it successfully deleted it, then it means it is either IE or the attachEvent() method was artificially added.