Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JS cross browser inconsistencies/differences

Tags:

javascript

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, setTimeout callback functions get passed an extra parameter (https://developer.mozilla.org/en/window.setTimeout).

Also, now that browsers are implementing new functions (e.g. Array.map), it can get confusing to know what you can/can't use if you are trying to write code that must work on all browsers (even back to IE6).

Is there a website that cleanly organizes these types of differences?

like image 993
Davis Dimitriov Avatar asked Sep 14 '11 20:09

Davis Dimitriov


2 Answers

I find QuirksMode and WebDevout to have the best tables regarding CSS and DOM quirks. You can bridge those incompatibilities with jQuery. There is also this great list started by Paul Irish which includes pretty much any polyfill you could ever need, including ones for ES5 methods such as Array.map.

like image 172
Alex Turpin Avatar answered Sep 20 '22 12:09

Alex Turpin


There doesn't appear to be anything out there that clearly outlines all these issues (very surprising actually). If you use jQuery there is a nice browser compatibility doc section that outlines supported browsers and known issues. I just deal with issues as they come up (as you should be browser testing in all cases anyways) and you can document them if you want to make sure you are coding correctly or if you run into issues and need to know fixes. It's easy to find issues when you do a quick search on a particular topic.

like image 30
fanfavorite Avatar answered Sep 23 '22 12:09

fanfavorite