摘要: 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) 编辑