上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 23 下一页
摘要: var _div = document.createElement("div"), //创建节点 txt1 = document.createTextNode("123"), //创建文本 // _b = document.createElement("b"), txt2 = document.c... 阅读全文
posted @ 2015-08-23 12:27 唸随爱 阅读(541) 评论(0) 推荐(0) 编辑
摘要: var _li = test.getElementsByTagName("li"), arrayObj = [].slice.apply(_li),//_li用apply调用slice方法(slice方法是类数组转成数组)放入新建的数组【】当中 len = arrayObj.length, i... 阅读全文
posted @ 2015-08-23 11:41 唸随爱 阅读(3467) 评论(0) 推荐(0) 编辑
摘要: url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和delete也可以使用,但仅部分浏览器支持。timeout: 要求为Number类型的参数,设置请求超... 阅读全文
posted @ 2015-08-18 13:06 唸随爱 阅读(224) 评论(0) 推荐(0) 编辑
摘要: $('.tab').click(function(){ var index = $('.tab').index(this), //缓存第一次点击的li的索引值 ele = $(this).find('.ind'); $('.tab').each(function(i){ if(i != in... 阅读全文
posted @ 2015-08-14 14:37 唸随爱 阅读(4092) 评论(0) 推荐(0) 编辑
摘要: location是javascript里边管理地址栏的内置对象,比如location.href就管理页面的url,用location.href=url就可以直接将页面重定向url。而location.hash则可以用来获取或设置页面的标签值。比如http://domain/#admin的locati... 阅读全文
posted @ 2015-08-05 17:25 唸随爱 阅读(183) 评论(0) 推荐(0) 编辑
摘要: demo1:你好 -->// console.log(test.nodeType,test.getAttribute("v"),test.nodeName,test.firstChild.nodeValue);//firstChild.nodeValue是第一个节点的value的值demo2: 1 ... 阅读全文
posted @ 2015-07-26 14:30 唸随爱 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 第一个页面:nihao第二个页面:var str = location.search, ary = str.substring(1).split("&"),//substring str中从第二个字母开始选择,split把字符串改成数组并用&间隔两个数据 endary = [], i = 0,... 阅读全文
posted @ 2015-07-26 11:51 唸随爱 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 视口的宽和高var pw = window.innerWidth, ph = window.innerHeight; if(typeof pw != "number"){ pw = document.documentElement.clientWidth; ph = document.d... 阅读全文
posted @ 2015-07-26 10:47 唸随爱 阅读(1584) 评论(0) 推荐(0) 编辑
摘要: // var guanbi = false; // $("#testbtn").click(function(){ // if(guanbi){ // $("#tan").hide(); // guanbi = false; // }else{ // $("#tan").show... 阅读全文
posted @ 2015-07-12 14:17 唸随爱 阅读(152) 评论(0) 推荐(0) 编辑
摘要: var a = (function(){ var c= 0; return function(){ return ++c; } }()); var g = a(); console.log(g); var e= a(); console.log(e); var f = a(); cons... 阅读全文
posted @ 2015-07-12 12:14 唸随爱 阅读(228) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 23 下一页