摘要: 1 2 3 4 5 6 7 8 阅读全文
posted @ 2014-10-21 12:18 暗语321 阅读(651) 评论(0) 推荐(0) 编辑
摘要: header固定定位,footer固定定位,左右固定(可以采用浮动)中间自适应 1 10 11 12 13 14 15 16 17 18 阅读全文
posted @ 2014-10-21 12:16 暗语321 阅读(477) 评论(0) 推荐(0) 编辑
摘要: //排序并获取index的顺序:4,7,2,9-->9,7,4,2-->4,2,1,3 Array.prototype.getIndex=function(){ var orderLength = this.length; var temp,tp; ... 阅读全文
posted @ 2014-10-21 12:10 暗语321 阅读(450) 评论(0) 推荐(0) 编辑
摘要: window.onload=function(){ var url="http://www.qq.com/index.html?key1=1&key2=2&key3=3"; var json={}; json['query']=url.split('?')[1]; ... 阅读全文
posted @ 2014-10-21 12:08 暗语321 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 方向反馈 阅读全文
posted @ 2014-10-21 12:05 暗语321 阅读(385) 评论(0) 推荐(0) 编辑
摘要: /*克隆一个对象*/方法一、 Object.prototype.deepClone=function(){ var buf; if (this instanceof Array) { buf = []; //... 阅读全文
posted @ 2014-10-21 12:02 暗语321 阅读(646) 评论(0) 推荐(0) 编辑
摘要: //数字转成汉字表示Number.prototype.toCn=function(){ var arrs=["零","一","二","三","四","五","六","七","八","九"]; var arrt=["","十","百","千","万","亿"]; var ... 阅读全文
posted @ 2014-10-21 11:42 暗语321 阅读(1377) 评论(0) 推荐(0) 编辑
摘要: Number.prototype.changeTo36=function(){ //进制映射 var arr36=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G",&quo 阅读全文
posted @ 2014-10-21 11:41 暗语321 阅读(1008) 评论(0) 推荐(0) 编辑
摘要: 方法一、window.onload=function(){ //寻找对象在父元素下的index function getIndexParent(element){ var oParent=element.parentNode; var oElement=oPa... 阅读全文
posted @ 2014-10-21 11:37 暗语321 阅读(388) 评论(0) 推荐(0) 编辑
摘要: function getByClass(oParent,oClass){ if(document.getElementsByClassName){ return document.getElementsByClassName(oClass); }else... 阅读全文
posted @ 2014-10-21 11:31 暗语321 阅读(164) 评论(0) 推荐(0) 编辑
摘要: function getRandomNumber(min,max){ var min = Math.floor(min); var max = Math.floor(max); return Math.floor(Math.random()*(max-min)); } function get... 阅读全文
posted @ 2014-10-21 11:26 暗语321 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 1 2 用户名 : 3 密 码 : 4 5 7 提交 8 下面的默认不会触发onsubmit()事件 9 10 提交-->非行间事件的写法 1 var obj = document.getElementById('myform'); 2 var check = function(... 阅读全文
posted @ 2014-10-21 10:41 暗语321 阅读(799) 评论(0) 推荐(0) 编辑
摘要: function loadjs(url,callback){ var script=document.createElement('script'); script.type="text/javascript"; script.src=url; if(script.onreadyst... 阅读全文
posted @ 2014-10-21 10:35 暗语321 阅读(1432) 评论(0) 推荐(0) 编辑
摘要: function maxStr(str1,str2){ var arr1=str1.split(""); var arr2=str2.split(""); var maxlen=0; var r1=0; for(var i=0;i<arr1.length;i++){ for(var ... 阅读全文
posted @ 2014-10-21 10:32 暗语321 阅读(168) 评论(0) 推荐(0) 编辑
摘要: window.onload=function(){ document.onclick=function(e){ var ev=e||event; var target=ev.target||ev.srcElement; var xhr=new XMLHttpRequest... 阅读全文
posted @ 2014-10-21 10:26 暗语321 阅读(228) 评论(0) 推荐(0) 编辑
摘要: var v1 = [] var v2 = {}; var v3 = {}; function foo(v1, v2, v3){ v1 = [1]; v2 = [2]; v3 = {a:3} } foo(v1, v2, v3); alert (v1); // 空白 alert (v... 阅读全文
posted @ 2014-10-21 10:14 暗语321 阅读(366) 评论(0) 推荐(0) 编辑
摘要: var str1='/qihoo/app/a/b/c/d/e/new.html';var str2='/qihoo/app/1/2/3/test.html';function changeToRelative(str1,str2){ var arr1=str1.split('/'); var a... 阅读全文
posted @ 2014-10-21 10:04 暗语321 阅读(171) 评论(0) 推荐(0) 编辑
摘要: // 定义类 类名字是 classA function classA(){ this.b=1; } classA.prototype.b=44; classA.prototype.show = function(){ alert(this.b); }; // 用new实例化 var b = new... 阅读全文
posted @ 2014-10-21 10:01 暗语321 阅读(327) 评论(0) 推荐(0) 编辑