Consider deprecating or updating $ #4979

scottjehl opened this Issue Sep 11, 2012 · 1 comment

1 participant


Including a polyfill for window.matchMedia might be handy to some users, but even if we keep it in jQM, our current $ function doesn't defer to a native implementation, so it needs an update.

The latest in the matchMedia polyfill repo would be good to use. Or, if we don't need to expose this at all in jQM, maybe we should deprecate for later removal.


Updating this to use native matchMedia when available (basically update it to this: could stand to improve our cold-start performance in newer platforms. @toddparker, @johnbender - sound good to you if I got ahead with this?

@scottjehl scottjehl pushed a commit that referenced this issue Sep 13, 2012
Scott Jehl updated our $ function to use the matchMedia polyfill, w…
…hich defers to the native function where possible. $ still returns a boolean as it always has, but now, window.matchMedia is exposed in unsupporting environments too, which gives developers access to its standard API that returns an object, and in native implementations, supports listeners as well (a polyfill is available for that part too). This addresses issue #4979
@scottjehl scottjehl was assigned Sep 13, 2012
@scottjehl scottjehl closed this in 555e07a Nov 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment