diff options
author | Rob Loach <robloach@gmail.com> | 2014-12-15 11:02:11 -0500 |
---|---|---|
committer | Rob Loach <robloach@gmail.com> | 2014-12-15 11:02:11 -0500 |
commit | a8bbc28c950093b4192060f1751744c7f81c145e (patch) | |
tree | f66bbb9db044ea1dfb2e598a0c05295a72d53d09 /jquery.once.js | |
parent | 4e47cb9089340aa069e94fa1bf8ee6886d3b780a (diff) | |
parent | 6a2ab3c7f9d58f2d47398ac29af06dec14c4612e (diff) | |
download | jquery-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.js | 5 |
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. |