Pregunta

Is there a library which makes all browser's JS interfaces comply to W3C standards?

For example, one that will add addEventListener to IE8, based on attachEvent.

¿Fue útil?

Solución

Every modern javascript framework offers you methods to even out these inconsistencies in the browsers js implementation (like jQuery's on handles addEventListener/attachEvent). Most of these frameworks however don't use the approach to alter the host objects (which is considered problematic) but their methods internally map to the according functions available in the specific browser.

I suggest you try one of those many popular frameworks (like e.g. jQuery, MooTools or Dojo to name only a few of the more popular ones).

I suggest to NOT use a framework which alters the host objects directly (as some of them tried in the earlier days and later discovered that this causes many problems).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top