摘要: 增加 a.unshift(在首部增加) var arr=[1,2,3]; console.log(arr.unshift(5)); console.log(arr); 4(数组长度) 5,1,2,3 var arr=[1,2,3]; console.log(arr.unshift([4,5,6])) 阅读全文
posted @ 2017-12-09 15:02 夏至有你 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 一、基本选择器 ID选择器 $("#id") 标签选择器 $("ele") 类选择器 $(".classname") 通配选择器 $("*") 组选择器 $("select1,select2") ID选择器 $("#id") 标签选择器 $("ele") 类选择器 $(".classname") 通 阅读全文
posted @ 2017-12-09 14:51 夏至有你 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 链接:在线jQueryhttp://www.bootcdn.cn 一、each(遍历) 1 $("ul li").each(function(index,value){ 2 alert(index+":"+$("value").html()); 3 }) 4 5 6 7 $.each($("ul l 阅读全文
posted @ 2017-12-09 14:47 夏至有你 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 一、单例模式(singleton) 1.概念:单个实例,只有一个对象,多次创建,返回同一个对象; 1 面向对象的实例对象 2 function Person(name,age){ 3 if(!Person.instance){ 4 Person.instance={ 5 name : "李四", 6 阅读全文
posted @ 2017-12-09 14:38 夏至有你 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 一、从github上下载项目 切换到存放git版本库的地方 Git clone url(github上的地址) 二、设置全局用户名 二、设置全局用户名 (提交代码的时候就会将用户名和邮箱存入版本库中,其他开发人员就可以看到是谁提交的代码) git config --global user.name 阅读全文
posted @ 2017-12-09 14:33 夏至有你 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 闭包 一、概念及作用 闭包是指在JavaScript中,内部函数总是可以访问其所在的外部函数中声明的参数和变量,即使在其外部函数被返回(寿命终结)了之后。 闭包是指在JavaScript中,内部函数总是可以访问其所在的外部函数中声明的参数和变量,即使在其外部函数被返回(寿命终结)了之后。 二、本质 阅读全文
posted @ 2017-12-09 14:29 夏至有你 阅读(326) 评论(0) 推荐(0) 编辑