![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
文章平均质量分 92
月夜楓
这个作者很懒,什么都没留下…
展开
-
JavaScript中清空数组的三种方式
转自:http://www.cnblogs.com/snandy/archive/2011/04/04/2005156.html 方式1,spliceview sourceprint? 1 varary = [1,2,3,4]; 2 ary.splice(0,ary.length); 3 console.log(ary); // 输出 [],空原创 2017-10-16 20:37:11 · 153 阅读 · 0 评论 -
JS的一些笔记
捕捉用户关闭窗口事件:window.onbeforeunload= function(){ alert("确定要关闭窗口么?"); }原创 2017-10-16 20:42:25 · 108 阅读 · 0 评论 -
js的一个前台验证框架
validatorForm.js /**这个errMsg对象是这个js验证的主体,是定义的验证的规范**/ var errMsg = { // 检查特定字段是否为必填 required : { msg : "->字段不能为空哦!", test : function(obj, load) { // 确保字段尚未有内容输入,并在页面加载时不做检查(在加载时显示"必填字段"可能会让用户感到厌原创 2017-10-16 20:43:04 · 769 阅读 · 0 评论 -
实现radio取消功能及checkbox单选
单选按钮(radio)的取消与选中 单选一 单选二 var tempradio= null;原创 2017-10-16 20:43:07 · 1089 阅读 · 0 评论 -
js模块化之自定义模块(页面模块化加载)
转自:http://blog.novanet.no/4-strategies-for-passing-parameters-to-requirejs-modules/转自:http://javascript.ruanyifeng.com/tool/requirejs.html入口:main1.jsrequire.config({ baseUrl : 'js', paths : { 'main':原创 2017-10-16 20:48:17 · 3316 阅读 · 0 评论 -
js 注册事件对象
$("#sample_manage").click(function(event){ console.log(event.target.tagName); console.log(event.target.id); }) ;原创 2017-10-16 20:48:20 · 185 阅读 · 0 评论 -
d3.js实现jquery.delegate函数
转自:http://stackoverflow.com/questions/26019127/svg-element-loses-event-handlers-if-moved-around-the-dom detail.jsp $(document).ready(function(){原创 2017-10-16 20:48:51 · 351 阅读 · 0 评论 -
精通D3.js学习笔记(2)比例尺和坐标
转自:http://www.cnblogs.com/chenjinxinlove/p/5608165.html1、线性比例尺d3.scale.linear() 创建一个线性比例尺 .domain([0,500]) 定义域 .range([0,1000]) 值域linear(x) 输入定义域 返回 值域linear.invert(y) 输入值域,返原创 2017-10-16 20:48:54 · 760 阅读 · 0 评论 -
在网页上面录制声音(chrome、firefox浏览器可用)
代码结构如下: VoiceController主要代码: @RequestMapping(value = "/voice2.do", method = RequestMethod.GET) public ModelAndView voice(HttpServletResponse response) { ModelAndView model = new ModelAndView("vo原创 2017-10-16 20:50:02 · 11267 阅读 · 0 评论