
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
实现的功能主要是上拉加载,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
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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.