
js
itxiaolong3
学习使我快乐
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
H5中监听返回页面的显示并刷新
问题描述:在微信中访问页面点击手机返回键时页面没刷新,如果是form提交的数据返回后没自动刷新,看不到效果。window.addEventListener('pageshow', function (e) { if(e.persisted || (window.performance && window.performance.navigation.type == 2))...原创 2020-03-30 11:32:28 · 1530 阅读 · 2 评论 -
js切割ip地址中的指定字符串
1,需求: 对 地址为 http://localhost/tpTest/foodshop/index.php/Index/index.html 进行切割,截取 http://localhost/tpTest/foodshop/ 这部分。实现方法:使用 index.of()和substring()方法结合 var getip = window.location.href;//获取全路径为ht...原创 2018-03-09 15:55:08 · 2353 阅读 · 0 评论 -
小程序中 rich-text 显示富文本
在使用 rich-text 来显示fuwq富文本时需要注意后台返回的数据是一个网页转义字符,直接使用rich-text的话是无法正常解析的。那么需要使用下面的一个方法进行反转义即可//小程序里的转义方法escape2Html: function (str) { var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' '...原创 2018-08-24 16:29:51 · 18051 阅读 · 0 评论 -
鼠标移动到图片上新增一个图层显示大图片
废话少说,直接上代码。代码抄自 懒人图库的。哈哈哈。效果如下:<style>.demo{overflow:hidden;width:120px;text-align:center;padding:10px;}.demo img{border:none;width:100px;height:100px;border:5px solid #f4f4f4} <!--...转载 2018-10-30 16:50:48 · 1287 阅读 · 0 评论 -
js实现复制功能
封装方法//定义函数 window.Clipboard = (function(window, document, navigator) { var textArea, copy; // 判断是不是ios端 function isO...转载 2019-06-22 13:10:40 · 2513 阅读 · 3 评论