Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-once

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-once

jQuery Once Plugin.

  • 2.0.0-alpha.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5K
increased by102.14%
Maintainers
1
Weekly downloads
 
Created
Source

jQuery Once Build Status

Filters out all elements that had the same filter applied on them before. It can be used to ensure that a function is only applied once to an element.

Usage

$('div.calendar').once('calendar', function() {
  // This function is only executed once for each div, even if this
  // code segment is executed repeatedly.
});
$('div.calendar').once('calendar').click(function() {
  // .once('calendar') filters out all elements which already have been
  // filtered with once(), and the elements that haven't been filtered
  // yet remain. The previous set of elements can be restored with
  // .end().
});

It also works without supplying a name:

$('div.calendar').once(function() {
  // This function is only executed once for each div, even if this
  // code segment is executed repeatedly. Other scripts can't refer
  // to this `once` method. The once data used to store execution are
  // in the form "jquery-once-1", "jquery-once-2", etc.
});

Development

Leverage npm, grunt, and qunit:

$ npm install
$ npm test
$ grunt release

License

Dual licensed under the MIT and GPL licenses.

Credits

Keywords

FAQs

Package last updated on 26 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc