随笔分类 -  JavaScript

摘要:Jquery 处理返回的 Json 数组 <script> for (var i = 0; i < photos.length; ++ i) { console.log(photos[i]); console.log(photos[i].imgurl); } </script> 阅读全文
posted @ 2019-11-15 14:46 GetcharZp 阅读(235) 评论(0) 推荐(0)
摘要:jquery 判断数组是否为空 if (data.length 0) { console.log("数组为空"); } 阅读全文
posted @ 2019-11-15 14:39 GetcharZp 阅读(8780) 评论(0) 推荐(0)
摘要:腾讯定位的使用 通过前端的JS代码获取到定位信息,在通过 POST 方法吧请求提交到后台服务器中 <script type="text/javascript" src="https://apis.map.qq.com/tools/geolocation/min?key=your key&refere 阅读全文
posted @ 2019-11-15 09:13 GetcharZp 阅读(700) 评论(0) 推荐(0)
摘要:Jquery才可以使用 this 指定当前DOM jquery获取并设置它的元素 <div class="shop-item" style="line-height: 30px" shopid="{$shop['id']}" shopname="{$shop['shopname']}" latng= 阅读全文
posted @ 2019-11-12 12:37 GetcharZp 阅读(264) 评论(0) 推荐(0)
摘要:使用 MUI 自制 弹出层 <div class="zp-mask" style="display: none; width: 100%;height: 100%;background-color: rgba(0,0,0,0.45); position: fixed;top: 0px;left: 0 阅读全文
posted @ 2019-11-11 16:07 GetcharZp 阅读(1393) 评论(0) 推荐(0)
摘要:a 标签添加 onclick 事件 <a href="javascript:void(0);" οnclick="js_method()">点击</a> 阅读全文
posted @ 2019-11-07 14:20 GetcharZp 阅读(697) 评论(0) 推荐(0)
摘要:# & 等特殊字符会导致 post 传参失败 处理方法使用 encodeURIComponent 将字符串转化一下 实例 // toUpperCase() 转化为大写字母 var catecolor = "#00FFFF"; var catecolor = encodeURIComponent(ca 阅读全文
posted @ 2019-11-06 16:55 GetcharZp 阅读(847) 评论(0) 推荐(0)
摘要:Ajax 请求 阅读全文
posted @ 2019-11-01 09:22 GetcharZp 阅读(175) 评论(2) 推荐(0)
摘要:失去焦点时,获取输入框的信息 获取到数据后,我们阔以通过Ajax或Post请求提交数据到后台 阅读全文
posted @ 2019-10-31 18:32 GetcharZp 阅读(1020) 评论(0) 推荐(0)
摘要:提示是否进行链接跳转 知识点: onclick="return confirm('确认跳转么?')" 代码: 阅读全文
posted @ 2019-10-30 09:40 GetcharZp 阅读(213) 评论(0) 推荐(0)
摘要:Canvas 入门 创建Canvas标签,标签内部的元素会在浏览器不支持Canvas时提示 通过 判断浏览器是否支持 Canvas 使用 输出文本 fillText 函数共有3个参数,(“文本内容”,“文本的水平位置”,“文本的垂直位置”) 使用 、`fillText`为图片添加文字脚注 + 将图片 阅读全文
posted @ 2019-10-25 17:53 GetcharZp 阅读(177) 评论(0) 推荐(0)
摘要:Node 入门 NodeJs 安装,HelloWorld + 下载地址 + 用 Node命令行输出HelloWorld NodeJs 创建应用 + http 模块引用 + 服务器创建 + 端口的监听 + 使用 node环境运行 + 代码整合 npm 包管理工具 + 在安装好 node.js 的时候就 阅读全文
posted @ 2019-10-24 22:47 GetcharZp 阅读(140) 评论(0) 推荐(0)
摘要:javascript jquery 修改指定标签中的内容 阅读全文
posted @ 2019-10-21 09:58 GetcharZp 阅读(1293) 评论(0) 推荐(0)
摘要:javascript 使用 setInterval 实现倒计时 javascript var timer = setInterval(function () { console.log(valid_time); if (valid_time 阅读全文
posted @ 2019-10-21 09:51 GetcharZp 阅读(573) 评论(0) 推荐(0)
摘要:设置按钮不可点击 阅读全文
posted @ 2019-10-21 09:38 GetcharZp 阅读(652) 评论(0) 推荐(0)
摘要:JavaScript获取当前时间 阅读全文
posted @ 2019-10-21 09:23 GetcharZp 阅读(141) 评论(0) 推荐(0)
摘要:使用Jquery获取指定属性的值 阅读全文
posted @ 2019-10-21 09:16 GetcharZp 阅读(1932) 评论(0) 推荐(0)
摘要:微信禁止分享 添加以下代码到网页中即可 阅读全文
posted @ 2019-10-18 18:21 GetcharZp 阅读(369) 评论(0) 推荐(0)
摘要:webStorm中NodeJs 没有智能提示 node.js and NPM --> Coding assistance for Node.js 阅读全文
posted @ 2019-10-14 23:17 GetcharZp 阅读(1098) 评论(0) 推荐(0)
摘要:通过canvas合成图片 效果图 页面布局部分 两个图片以及一个canvas画布 JavaScript代码部分 代码合总 阅读全文
posted @ 2019-09-25 12:03 GetcharZp 阅读(332) 评论(0) 推荐(0)