summaryrefslogtreecommitdiffstats
path: root/jquery.once.js
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2014-12-15 11:02:11 -0500
committerRob Loach <robloach@gmail.com>2014-12-15 11:02:11 -0500
commita8bbc28c950093b4192060f1751744c7f81c145e (patch)
treef66bbb9db044ea1dfb2e598a0c05295a72d53d09 /jquery.once.js
parent4e47cb9089340aa069e94fa1bf8ee6886d3b780a (diff)
parent6a2ab3c7f9d58f2d47398ac29af06dec14c4612e (diff)
downloadjquery-once-a8bbc28c950093b4192060f1751744c7f81c145e.zip
jquery-once-a8bbc28c950093b4192060f1751744c7f81c145e.tar.gz
jquery-once-a8bbc28c950093b4192060f1751744c7f81c145e.tar.bz2
Initial run of Grunt removal
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 1f770c1..c8e606c 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -51,8 +51,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.