bcardarella/client_side_validations — Issue #247: Firefox throw exception when not in quirks mode
Author: jeremywadsack
Created: 2011-12-29 23:24:45+00:00
State: open

We've had this happen on one of our pages and not on others, so there may be something else I'm missing, but [line 14 of /vendor/assets/javascripts/rails.validations.js](https://github.com/bcardarella/client_side_validations/blob/master/vendor/assets/javascripts/rails.validations.js#L14) uses global window named items which is not supported by Firefox except in quirks mode, so that it fails with "settings is undefined".

Changing this to use getElementById seems to fix the problem.

There is a lot of argument about [the 'right' way to do this](http://stackoverflow.com/questions/3434278/ie-chrome-are-dom-tree-elements-global-variables-here). The original approach should be supported in IE and
[HTML5-compatible browsers](http://dev.w3.org/html5/spec/Overview.html#named-access-on-the-window-object) except that [as of 5/13/2011 Gecko does *not* plan to support this except in quirks mode](https://www.w3.org/Bugs/Public/show_bug.cgi?id=11960#c16).