会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
幻景
博客园
首页
新随笔
联系
管理
订阅
2020年5月8日
cookie、localStorage、sessionStorage 差异与使用方法
摘要: /* cookie */ Cookie 是一些数据, 存储于你电脑上的文本文件中。 当 web 服务器向浏览器发送 web 页面时,在连接关闭后,服务端不会记录用户的信息。 读取Cookie: 在 JavaScript 中, 可以使用以下代码来读取 cookie: var x = document.
阅读全文
posted @ 2020-05-08 15:12 幻景
阅读(149)
评论(0)
推荐(0)
2020年4月24日
处理iframe内部点击没有反应、跨域点击被拦截
摘要: var IframeOnClick = { resolution: 500, iframes: [], interval: null, Iframe: function() { this.element = arguments[0]; this.cb = arguments[1]; this.has
阅读全文
posted @ 2020-04-24 16:12 幻景
阅读(2606)
评论(0)
推荐(0)
2020年3月26日
js 点击复制功能兼容
摘要: copytext("需要复制的内容",function(){ alert("复制成功!");});function copytext(txt,cd){ var Url2 = txt; var oInput = document.createElement('input'); oInput.value
阅读全文
posted @ 2020-03-26 10:35 幻景
阅读(324)
评论(0)
推荐(0)
判断ie版本
摘要: if(navigator.appName "Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE","")) <9){//如果等于ie
阅读全文
posted @ 2020-03-26 10:21 幻景
阅读(135)
评论(0)
推荐(0)
2019年12月17日
js 面向对象的 原型的模式创建对象
摘要: window.onload = function(){ var D1 = new yzzMethod(); D1.upload('参数');};function yzzMethod(){ this.status = new Object(); console.log('初始化的时候会运行到这里');
阅读全文
posted @ 2019-12-17 10:24 幻景
阅读(170)
评论(0)
推荐(0)
2019年12月2日
js 中文转拼音
摘要: <!DOCTYPE HTML><html><head> <title>用JS实现汉字转拼音</title> <meta charset="utf-8" /> </head><body>请输入:<input type="text" id="J_input" /><br/><br/><input typ
阅读全文
posted @ 2019-12-02 11:14 幻景
阅读(762)
评论(0)
推荐(0)
2019年11月18日
jquery 获取背景图片的宽高
摘要: <script type="text/javascript">/* 拿到背景 */var url=$('.wrap').css('backgroundImage');/* 正则删掉不需要的信息,保留图片的链接 */var s = url.match(/url\((.*?)\)/);/* 返回一个数据
阅读全文
posted @ 2019-11-18 18:43 幻景
阅读(1087)
评论(0)
推荐(0)
2019年11月5日
js 工作简单封装常用的思想写法。面向对象
摘要: ;(function($,window){ function commonYzzFn(){ var _t = this; _t.init = function(param){ var before_foo = param.before; var after_foo = param.after; be
阅读全文
posted @ 2019-11-05 18:31 幻景
阅读(229)
评论(0)
推荐(0)
2019年10月29日
php下载文件,线上文件下载
摘要: 1.多个文件下载 <?php /* 把知道的图片问题名字做成一个数组 */ $mp4 = ['123','456']; /* count($mp4) 类似于 js 的 $mp4.length */ for ($i=1; $i<=count($mp4); $i++){ /* 线上的资源文件 */ $u
阅读全文
posted @ 2019-10-29 11:15 幻景
阅读(278)
评论(0)
推荐(0)
2019年9月4日
e.target与事件委托简例(原生和jQuery的区别)
摘要: target定义(英译:目标,目的): target 事件属性可返回事件的目标节点(触发该事件的节点),如生成事件的元素、文档或窗口。 语法: event.target event.target.nodeName //获取事件触发元素标签name(li,p...) event.target.id /
阅读全文
posted @ 2019-09-04 16:31 幻景
阅读(553)
评论(0)
推荐(0)
下一页
公告