
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
实现的功能主要是上拉加载,demo,相关原理的简单介绍见这里;
最简单的方法,就是直接从项目中下载src/pullreload.min.js或者src/pullreload.js。 在页面中引入,源代码见index.html
<div id='ptr'></div>
<div id="content">a long list that need to be refresh when pull down</div>
<script src="src/pullreload.min.js"></script>
<script>
var pull = new pullReload({
content:'content',//元素id,必须,表示拖动哪个元素进行下拉刷新
ptr:'ptr',//元素id,必须,指定
callback:function(){//回调,非必须,默认输出异步的话返回promise,同步无所谓
//如浏览器不支持promise,则无法执行异步回调,建议配合webpack进行bundle
console.log('123');
}
});
pull.start();
</script>
配合webpack使用,webpack的参考依赖可以看本仓库中的webpack.config.js,主要是babel-loader和css-loader以及style-loader。
import pullreload from 'pullreload';
var pull = new pullreload({
content:'content',
ptr:'ptr',
callback:function(){
console.log('123');
}
});
pull.start();
本人小菜鸟一枚,用原生写了一个简单的上拉加载,也算体验了一把npm,原生js组件的玩法,还有很多不足,欢迎issues
FAQs
pull to reload using javascript
The npm package pullreload receives a total of 2 weekly downloads. As such, pullreload popularity was classified as not popular.
We found that pullreload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.