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, 3 insertions, 2 deletions
diff --git a/jquery.once.js b/jquery.once.js
index 4664218..87741f9 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -53,8 +53,9 @@
* @public
*/
$.fn.once = function (id) {
- if (!id) {
- throw new Error("An ID is required when calling jQuery.once()");
+ id = id || "once";
+ if (typeof id !== "string") {
+ throw new Error("jQuery.once() parameter MUST be a string");
}
// Build the name for the data identifier. Generate a new unique id if the
// id parameter is not provided.