摘要: var userAgent = navigator.userAgent; if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") !=-1) { window.location.href="about:blank"; window.close(); } else { window.opener = nu... 阅读全文
posted @ 2016-10-25 09:55 lhy031 阅读(512) 评论(0) 推荐(0) 编辑
摘要: 方法一(闭包): PS:该方法是最后一张加载完成即加载完成。如想判断全部加载完成可定义变量比较是不是img的长度,或者用方法二。 方法二: 使用deferred 阅读全文
posted @ 2016-10-21 16:56 lhy031 阅读(321) 评论(0) 推荐(0) 编辑
摘要: jQuery(function($){ // 备份jquery的ajax方法 var _ajax=$.ajax; // 重写ajax方法, $.ajax=function(opt){ var _success = opt && opt.success || func... 阅读全文
posted @ 2016-10-19 11:44 lhy031 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 一 绑定域名: 先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”。 PS: 例如域名为:http://ge.lp.com,则只需填ge.lp.com 二 引入js: (支持https):http://res.wx.qq.com/open/js/jweixin-1.0.0. 阅读全文
posted @ 2016-10-18 16:34 lhy031 阅读(684) 评论(1) 推荐(1) 编辑
摘要: 电话: 网址: 去掉字符串两侧的空格 匹配html: 匹配js: 匹配身份证: 阅读全文
posted @ 2016-10-18 15:06 lhy031 阅读(186) 评论(0) 推荐(0) 编辑
摘要: // 时间戳转化为时间 function getDT (unix) { var time = new Date(unix*1000); var y = time.getFullYear(); var m = time.getMonth()+1; var d = time.getDate(); var 阅读全文
posted @ 2016-10-10 14:39 lhy031 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 红色部分是本地flvplayer.swf和vcastr.xml的的地址。flvplayer.swf的下载:http://www.lanrentuku.com/js/shipin-1022.html; 如果不加?vcastr_xml=exter/vcastr.xml会报找不到vcastr.xml的错. 阅读全文
posted @ 2016-09-29 17:47 lhy031 阅读(451) 评论(0) 推荐(0) 编辑
摘要: function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" 阅读全文
posted @ 2016-09-22 17:09 lhy031 阅读(269) 评论(0) 推荐(0) 编辑
摘要: webpack例子:https://github.com/Aquarius1993/webpackDemo 1. 需要全局和项目安装webpack和webpack-dev-server 2. 配置webpack.config.js 3. 运行项目 阅读全文
posted @ 2016-09-12 10:18 lhy031 阅读(4998) 评论(0) 推荐(0) 编辑
摘要: //判断是不是PC function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v 0) ... 阅读全文
posted @ 2016-09-09 18:02 lhy031 阅读(297) 评论(1) 推荐(0) 编辑