Heh, ok so I'm sure I'm not the only one to have been surprised-of-late by FireFox's sudden interest in incrementation. They've gone a bit +1 all in the name of Rapid Release..? It seems more to me that the browser developers are just feeling inadequate about the size of their version numbers - the whole "Mega Pixel" irrational again.
Quite why Opera's double figures never made the Mozilla foundation flinch before i don't know... But I guess Chrome must really be worrying certain people. Not sure why myself, any browser that keeps overriding my typed location with an erroneous "empty tab" does not make it to the coveted "Default Browser" status as far as I'm concerned.
Skip to the end...
Anyway, all the above nonsense aside, something interesting did pop up from all these "upgrade to the latest beta" popups. It seems the latest FF v6 has added support for something I had totally managed to miss before now...
window.matchMedia()
In short this should help a great deal when dealing with projects destined for use on a multitude of devices. Put simply, It allows you to harness the power of media queries from within JavaScript (so no longer just CSS) and not only that, it also allows EventListeners to be added to these media queries - so state change can be detected easily. Modern day web developers really don't know how easy they have it ;)
For more information about this new addition check the link below:
http://dbaron.org/log/20110422-matchMedia
PS:
As a side note to this, and just in case you don't know - there are a few other functions in a similar vein (i.e. CSS abilities made available in JavaScript) which have sprung up (possibly due to jQuery/Sizzle's prevalence.. I'm not sure) but one I keep meaning to sit down with and see how well it works is the following:
Window.querySelector()
Basically exposing something that (looking back) should always have been accessible since the advent of CSS - just like Document.getElementsByClassName() - which is the ability to use the power of the CSS selector engine from JavaScript.
https://developer.mozilla.org/En/DOM/Document.querySelector
- Leave your comment • Category: Coding, User agents
- Share on Twitter, Facebook, Delicious, Digg, Reddit