Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 822 Bytes

README.md

File metadata and controls

32 lines (21 loc) · 822 Bytes

#jQuery Selector Cache

Cache your selectors, without messy code.

##Installation

  1. Include the /src/jquery.sc.js file after your copy of jQuery.

##Basic Usage

//Instead of
$('div')

//use
$$('div')

The next time you call $$('div') it will be fetched from the cache.

##Options

  • $$('div') The next time you call $$('div') it will be fetched from the cache.
  • $$('div', 'clear') Invalidates the cache. The next time you call $$('div') It will return fresh results.
  • $$('div', 'fresh') Shortcut for doing $$('div', 'clear') $$('div')

##Benchmarks

No cache: 444ms
Selector Cache plugin: 3ms
Storing results in variables: 2ms