JS cross browser inconsistencies/differences

前端 未结 3 905
故里飘歌
故里飘歌 2021-02-06 04:19

There are lots of DOM/CSS inconsistencies between browsers. But how many core JS differences are there between browsers? One that recently tripped me up is that in Firefox, setT

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 05:00

    Well, I'm going to open up a CW:

    • Prior to Firefox 4 Function.apply only accept an Array, not an array-like object. Ref MDC: Function.apply
    • Some engines (which ones?) promote the result of String.prototype methods from string to String. Ref a String.prototype's "this" doesn't return a string?
    • Firefox 4 may insert "event loops" into seemingly synchronous code. Ref Asynchronous timer event running synchronously ("buggy") in Firefox 4?
    • Earlier Firefox versions would accept a trailing , in object literals. Ref trailing comma problem, javascript (Seems "fixed" in FF6).
    • Firefox and IE both treat function-expression productions incorrectly (but differently).
    • Math.round/Math.toFixed. Ref Math.round(num) vs num.toFixed(0) and browser inconsistencies
    • The IE vs. W3C Event Model -- both are missing events/features of the other.

提交回复
热议问题