I ‘ve noticed that my images( the links around them) that i load with ajax calls arent have the click event triggered on them, so the lightbox is not working on theses new elements,
I think this comes from a wrong syntax of .on() function; 查看全文
I ‘ve noticed that my images( the links around them) that i load with ajax calls arent have the click event triggered on them, so the lightbox is not working on theses new elements,
I think this comes from a wrong syntax of .on() function; 查看全文
search 查找。返回字符串的位置,没有则返回-1
substring 截取子字符串。不包括结束位置
charAt 获取某个字符串的一位。
split 分割字符串,获得数组
match获取匹配的项目。保存在数组,并返回
replace 替换所有的匹配,返回替换后的字符串 查看全文
代码编辑器或者文本编辑器,对于程序员来说,就像剑与战士一样,谁都想拥有一把可以随心驾驭且锋利无比的宝剑,而每一位程序员,同样会去追求最适合自己的强大、灵活的编辑器,相信你和我一样,都不会例外。
如果说“神器”是我能给予一款软件最高的评价,那么我很乐意为它封上这么一个称号。sublime text 2(以下简称ST2)小巧绿色且速度非常快,跨平台支持Win/Mac/Linux,支持32与64位,支持各种流行编程语言的语法高亮、代码补全等,但ST2有着很多其他编辑器没有的超酷的特性,让它的好用达到了前所未有的程度…… 查看全文
1 2 |
document.cookie=”user=blue”; document.cookie=”password=123456” //cookie只会添加不会覆盖,所以会存在两条数据 |
本地测试cookie时,IE和Chrome不会正常保存,只有Firefox能正常使用cookie 查看全文
解决方案
1 2 3 4 5 6 7 8 |
获取ul里li的个数,即li为元素节点 for(var i=0;i<oul.childnodes.length;i++){ If(oUl.childNodes[i].nodeType==1){ //进行操作 } } 通过children,只算第一层 alert(oUl.children.length) |