summaryrefslogtreecommitdiffstats
path: root/jquery.once.js
diff options
context:
space:
mode:
Diffstat (limited to 'jquery.once.js')
-rw-r--r--jquery.once.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/jquery.once.js b/jquery.once.js
index 5deed57..a547c1a 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -13,7 +13,10 @@
uuid = 0;
$.fn.once = function(id) {
var name;
- name = "jquery-once-" + (id || ++uuid);
+ if (!id) {
+ throw new Error("An ID is required when calling jQuery.once()");
+ }
+ name = "jquery-once-" + id;
return this.filter(function() {
return $(this).data(name) !== true;
}).data(name, true);