js 获取粘贴数据 ctrl + V

摘要: ctrl+c从excel or 其他地方复制数据,然后粘贴到html页面,首先获取粘贴的数据,支持Chrome,IE,Firefox; 捕获键盘时间Ctrl+c keycode 86, textarea会根据换行符自动换行,所以放到textarea里。 贴代码: <html><body ><scri 阅读全文
posted @ 2016-10-12 14:04 dwk106 阅读(1886) 评论(1) 推荐(1)

动态添加删除css/js文件

摘要: var gTag = 1;function clickButton(){if(gTag == 1){ //加载js /*var linkObj = document.createElement("script"); linkObj.setAttribute("src","b.js"... 阅读全文
posted @ 2015-07-01 11:12 dwk106 阅读(452) 评论(0) 推荐(0)

改变input框number类型默认样式

摘要: 当input的type="number"时,会显示默认的自增自减样式,去掉样式设置如下:input::-webkit-outer-spin-button,input::-webkit-inner-spin-button { -webkit-appearance: none !important... 阅读全文
posted @ 2015-06-18 14:35 dwk106 阅读(893) 评论(0) 推荐(0)

js类定义

摘要: function Person(name) { this.name = name; this.say = function() { console.log(this.name) }} 等价于function Person(name) { this.na... 阅读全文
posted @ 2015-06-15 16:25 dwk106 阅读(117) 评论(0) 推荐(0)

值得关注的web前端项目

摘要: http://segmentfault.com/a/1190000002804472 阅读全文
posted @ 2015-06-03 13:43 dwk106 阅读(115) 评论(0) 推荐(0)

获取屏幕尺寸

摘要: 获取屏幕尺寸网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth (包括边线的宽)网页可见区域高:document.body.offsetHeight ... 阅读全文
posted @ 2015-06-03 09:42 dwk106 阅读(149) 评论(0) 推荐(0)