摘要:
1.封装方法: 2.调用: 阅读全文
摘要:
<div class="js-text">test<span>subtest</span></div> <script type="text/javascript"> $(function(){ var text = $('.js-text').contents()[0].data; console 阅读全文
摘要:
用到的知识点:Math.random()//用于打乱数组索引 random() 方法可返回介于 0(包含) ~ 1(不包含) 之间的一个随机数。 阅读全文
摘要:
我们都知道下载文件有一种很简单的方法:window.open(url),但是window.open(url)只是一个纯粹的访问下载文件的链接,并不能满足所有下载文件的需求。 1.前端下载文件有时候会根据权限去下载(需要获取登录的token) 2.有时后端提供的是post请求的接口 3.自定义文件名 阅读全文
摘要:
用到的属性offsetTop、方法scrollTop() 1.offsetTop//返回当前元素顶部相对指定元素顶部的偏移量 2.scrollTop()//返回或设置匹配元素的滚动条的垂直位置 举个栗子: 好了,自行去封装吧! 阅读全文
摘要:
在angular项目中下载依赖npm install时提示node-sass安装失败,解决方法如下: 1.下载win32-x64-57_binding.node文件至指定目录 2.添加环境变量: 变量名:SASS_BINARY_PATH 变量值:E:\Program Files\win32-x64- 阅读全文
摘要:
var ue=null; //在初始化富文本的地方 if (ue == null) { ue = new baidu.editor.ui.Editor(); ue.render('inspectionEditor'); } ue.ready(function () { ue.setHeight(200); ue.setContent(''); }); 阅读全文
摘要:
方法一:(setInterval) $("#getCode").on("click", getCodeClick); function getCodeClick() { $("#getCode").off("click"); try { new common.ajaxRequest({ url: u 阅读全文