![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
Henry Fox
这个作者很懒,什么都没留下…
展开
-
JavaScript中的sleep函数 2021-08-25
来自 https://stackoverflow.com/a/951057// sleep time expects millisecondsfunction sleep (time) { return new Promise((resolve) => setTimeout(resolve, time));}// Usage!sleep(500).then(() => { // Do something after the sleep!});转载 2021-08-26 13:12:21 · 108 阅读 · 0 评论 -
JS自动化实战-自动选择下载 2021-08-25
需求描述:在腾迅魏云网页端进行下载,选择该页面所有文件下载。解决方案:直接使用Chrome,执行以下代码:function sleep(time) { return new Promise((resolve) => setTimeout(resolve, time));}function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDER原创 2021-08-25 14:28:37 · 103 阅读 · 0 评论 -
网页图片下载并编辑为单个文件 2021-07-20
百度文库开通了VIP之后发现VIP文档下载特权只能下载两篇,感觉非常不爽。在网站 https://wenku.baidu.com/view/556bf8b430126edb6f1aff00bed5b9f3f90f72b8.html 尝试了一下。每个页面都是一个图片,所以可以直接下载单个图片拼起来。具体方法:先点击加载把所有页面都读取出来;在console执行:items = document.getElementsByClassName("ppt-page-item")imglist = [];原创 2021-07-20 13:19:00 · 116 阅读 · 0 评论 -
JS中的argsort
stackoverflow提供的解决方案: ( https://stackoverflow.com/questions/46622486/what-is-the-javascript-equivalent-of-numpy-argsort )const dsu = (arr1, arr2) => arr1 .map((item, index) => [arr2[index], item]) // add the args to sort by .sort(([arg1], [arg2]原创 2021-07-18 18:11:11 · 145 阅读 · 0 评论 -
微信小游戏开发 2018-07-09
微信小游戏创建正常到mp.weixin.qq.com新建小程序,在新建完后选择类目选上小游戏即可。之后到微信开发者工具创建新的小程序,填入appid,就可以新建demo。微信小程序实例在demo里面,已经有打飞机的一个游戏,里面readme已经给了整体架构:./js├── base // 定义游戏开发基础类│ ├── animatoin.js // 帧动画的简易实现│ ├─原创 2021-07-18 16:50:33 · 174 阅读 · 1 评论