
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
jquery-once
Advanced tools
Act on jQuery elements only once.
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.
Method | Installation |
---|---|
npm | npm install jquery-once --save |
Composer | composer require robloach/jquery-once |
Bower | bower install jquery-once |
Component | component install RobLoach/jquery-once |
jsDelivr | //cdn.jsdelivr.net/npm/jquery-once@2.3.0/jquery.once.min.js |
cdnjs | //cdnjs.cloudflare.com/ajax/libs/jquery-once/2.3.0/jquery.once.js |
See the API documentation for more information on how to use jQuery Once.
// The following will change the color of each paragraph to red, just once
// for the "changecolor" key.
$('p').once('changecolor').css('color', 'red');
// .once() will return a set of elements that yet to have the once ID
// associated with them. You can return to the original collection set by
// using .end().
$('p')
.once("changecolorblue")
.css("color", "blue")
.end()
.css("color", "red");
// To execute a function on the once set, you can use jQuery's each().
$('div.calendar').once().each(function() {
// Since there is no once ID provided here, the key will be "once".
});
node --version
npm install
npm test
jquery.once.min.js
with:npm run build
npm run docs
git add -A
git commit -m "2.3.0"
git tag 2.3.0
git push origin 2.3.0
npm publish
Discover the change history by heading on over to the CHANGELOG.md
file.
Dual licensed under:
Copyright © Rob Loach
[2.3.0] - January 4th, 2024
var
to let
and const
for variable scopeuse strict
directivesFAQs
Act on jQuery elements only once.
The npm package jquery-once receives a total of 4,175 weekly downloads. As such, jquery-once popularity was classified as popular.
We found that jquery-once demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.