Prefixing pitfall: "var foo = window.foo || window.mozFoo || window.oFoo || window.msFoo || window.webkitFoo" only works if foo is prefixed.
3
3
2
@bz_moz Huh? Wouldn't an unprefixed pass the first || and get returned?
3
Replying to @tabatkins
@tabatkins @bz_moz It works inside a function, but doesn't work at toplevel since |var foo| overwrites window.foo before reading it.

Jul 8, 2012 · 7:45 PM UTC

1
2
1
Replying to @davidbaron
@davidbaron @tabatkins @bz_moz Interesting. However, at the top level, I would have used "window.foo = window.foo || ..." anyway.