querySelectorAll is coming fast

Written by on August 21st, 2008 in Uncategorized.

We have all been talking about querySelectAll for awhile, but John Resig gives us a wrap-up that covers the state of play.

He talks about the browsers, and the libraries that wrap them and clean up shop via code like:

JAVASCRIPT:

  1.  
  2.  
  3. function querySelectorAll(selector){
  4.   try {
  5.     return Array.prototype.slice.call(
  6.       document.querySelectorAll( selector ) );
  7.   } catch(e){}
  8.  
  9.   return myOtherLibrary( selector );
  10. }
  11.  

Less code. More speed.

Source: Ajaxian » Front Page
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/370931649/queryselectorall-is-coming-fast

Comments are closed.



Site Navigation