diff options
Diffstat (limited to 'jquery.once.js')
-rw-r--r-- | jquery.once.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/jquery.once.js b/jquery.once.js index dd825f4..affaaed 100644 --- a/jquery.once.js +++ b/jquery.once.js @@ -9,16 +9,12 @@ factory(jQuery); } })(function($) { - var cache, uuid; - cache = {}; + var uuid; uuid = 0; $.fn.once = function(id) { var name; - if (typeof id !== "string") { - if (!(id in cache)) { - cache[id] = ++uuid; - } - id = cache[id]; + if (!id) { + id = ++uuid; } name = "jquery-once-" + id; return this.filter(function() { |