随笔分类 -  JS

摘要:资料介绍说HEAD请求和GET 请求差不多,但是没有响应数据,可以用来检查文件存不存在。而不必下载文件。 说法参考:https://gitee.com/vincentyun/jsnote/issues/I2DHZD 于是做了个实验: 本地启动一个简单的服务:http://localhost:93/1 阅读全文
posted @ 2022-12-20 14:11 liuw_flexi 阅读(379) 评论(0) 推荐(0) 编辑
摘要:String对象的方法 方法一: indexOf() (推荐) var str = "123"; console.log(str.indexOf("3") != -1 ); // true indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置。如果要检索的字符串值没有出现,则该方 阅读全文
posted @ 2020-09-28 09:27 liuw_flexi 阅读(1601) 评论(0) 推荐(0) 编辑
摘要:code参考了: https://www.cnblogs.com/woshidouzia/p/9304603.html //测试数组 let arr = [1,2,3,4,5,6,7] console.log(" 1.for循环 ") for(let j=0, len = arr.length; j 阅读全文
posted @ 2020-09-21 09:54 liuw_flexi 阅读(164) 评论(0) 推荐(0) 编辑
摘要:.part5-bg .swiper2 .swiper-pagination2{ bottom: 0.4rem; } /*未选中的小圆点样式*/ .part5-bg .swiper2 .swiper-pagination2 .swiper-pagination-bullet { width: 5px; 阅读全文
posted @ 2019-12-23 09:20 liuw_flexi 阅读(276) 评论(0) 推荐(0) 编辑
摘要:1. Swiper 的上一页,下一页按钮,不是必需包含在container 中的 2. 定义上一页,下一页按钮的样式,CSS略.... 3. 在初始化Swiper中,定义上一页,下一页按钮 阅读全文
posted @ 2019-12-17 16:36 liuw_flexi 阅读(4837) 评论(1) 推荐(0) 编辑
摘要:效果: <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript" src="./js/jquery-1.12.4.mi 阅读全文
posted @ 2019-12-06 11:57 liuw_flexi 阅读(334) 评论(0) 推荐(0) 编辑
摘要://直接给所有img标签绑定click事件 ("img").click(function()alert();)//使bindclick("img").bind("click",function(){ alert('你点击了图片'); }) 阅读全文
posted @ 2019-11-21 16:28 liuw_flexi 阅读(1566) 评论(0) 推荐(0) 编辑
摘要:1. 从官网下载必要资源 https://www.swiper.com.cn/download/index.html#file1 2. 在项目中<head>中引入swiper.min.css <!-- Link Swiper's CSS --> <link rel="stylesheet" href 阅读全文
posted @ 2019-11-18 15:03 liuw_flexi 阅读(1469) 评论(0) 推荐(0) 编辑
摘要:用script标签,src是js文件路径 <script type="text/javascript" src="./js/udc.js"></script> 如果项目中用到了jquery,同样src是jquery文件路径 <script type="text/javascript" src="./ 阅读全文
posted @ 2019-11-18 10:08 liuw_flexi 阅读(545) 评论(0) 推荐(0) 编辑
摘要:对null执行typeof预算,结果返回字符串'object',也就是说,可以将null认为是一个特殊的对象值,含义是“非对象“。 例如:用typeof obj ‘object’判断obj是否是一个object 写法一: 写法二: 后者更为严谨 typeof在检测到null时也会显示为object, 阅读全文
posted @ 2019-11-14 11:39 liuw_flexi 阅读(271) 评论(0) 推荐(0) 编辑
摘要:http://funteas.com/topic/592f828e572bfb9c4d965ab0 阅读全文
posted @ 2017-06-01 11:42 liuw_flexi 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1、对于string,number等基础类型,==和 是有区别的 1)不同类型间比较,==之比较“转化成同一类型后的值”看“值”是否相等, 如果类型不同,其结果就是不等 2)同类型比较,直接进行“值”比较,两者结果一样 2、对于Array,Object等高级类型,==和 是没有区别的 进行“指针地址 阅读全文
posted @ 2017-04-13 18:06 liuw_flexi 阅读(132) 评论(0) 推荐(0) 编辑
摘要:自执行匿名函数: 常见格式:(function() { /* code */ })(); 解释:包围函数(function(){})的第一对括号向脚本返回未命名的函数,随后一对空括号立即执行返回的未命名函数,括号内为匿名函数的参数。 作用:可以用它创建命名空间,只要把自己所有的代码都写在这个特殊的函 阅读全文
posted @ 2017-04-13 17:16 liuw_flexi 阅读(311) 评论(0) 推荐(0) 编辑
摘要:1.(function(){alert("1")})()(function(){alert("2")})()报错 2.(function(){alert("1")})();(function(){alert("2")})()正确 没有分号分隔挨着的函数,就会出错。应该跟JS的解析有关。 脚本压缩,前 阅读全文
posted @ 2017-04-13 17:09 liuw_flexi 阅读(1031) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示