Skip to content

adamdb/jquery-selector-cache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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

About

Cache your selectors, without messy code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.4%
  • CSS 7.6%