随笔分类 -  JS

摘要:function A(p) {}function C(p1, p2) {}function D(p1,p2,p3) {}function B() { var method = arguments[0]; var parms = []; for (var i = 1; i < arg... 阅读全文
posted @ 2015-03-17 17:30 JasonGu0 阅读(168) 评论(0) 推荐(0)
摘要:在body标签内的第一行放置一个然后在body的最底部或任意位置放置一个back to top 阅读全文
posted @ 2015-02-26 11:22 JasonGu0 阅读(131) 评论(0) 推荐(0)
摘要://格式化时间【参数是一个字符串,格式类似于 /Date(1425027069000)/ 】function formatDate(n) { var s = n.slice(6, 21); dt = new Date(parseInt(n.slice(6, 21))); var y... 阅读全文
posted @ 2015-02-13 09:22 JasonGu0 阅读(636) 评论(0) 推荐(0)
摘要://执行setTimeOut函数返回的ID var timeOutCount; //周期(以毫秒/ms为单位),平均每3秒刷新一次 var timeCycle = 3000; $(function () { getData(); }); //向服... 阅读全文
posted @ 2015-01-30 11:54 JasonGu0 阅读(445) 评论(0) 推荐(0)
摘要:$("form ~ input") 匹配 form 元素之后的所有 form 元素 【包含子级、孙、曾孙.......】 $("label + input") 匹配所有紧接在 label 元素后的 input 元素【下一个兄弟元素】 $("form > input") 在给定的父元... 阅读全文
posted @ 2015-01-24 17:14 JasonGu0 阅读(290) 评论(0) 推荐(0)
摘要:var s= document.getElementById("id");var chils= s.childNodes; //得到s的全部子节点var par=s.parentNode; //得到s的父节点var ns=s.nextSbiling; //获得s的下一个兄弟节点【该变量测试... 阅读全文
posted @ 2015-01-16 12:45 JasonGu0 阅读(195) 评论(0) 推荐(0)
摘要://ASCII码转换字符function asciiToStr(code) { //alert("code:" + code + "\r\n字符:" + String.fromCharCode(code)); return String.fromCharCode(code);}//字符转... 阅读全文
posted @ 2015-01-15 17:39 JasonGu0 阅读(668) 评论(0) 推荐(0)
摘要:// 保存 Cookiefunction setCookie(name, value) { expires = new Date(); expires.setTime(expires.getTime() + (1000 * 86400 * 365)); document.cooki... 阅读全文
posted @ 2014-12-27 17:07 JasonGu0 阅读(152) 评论(0) 推荐(0)
摘要:1.JS去掉字符串首尾空格符(利用正则表达式) //去掉首尾的空格符 function trim(vStr) { // 首 尾 return vStr.replace(/(^\s*)/g, "").replace(/(\s*$)/g, ""); }2.Json对象转换成字符串 var last=ob... 阅读全文
posted @ 2014-12-18 13:47 JasonGu0 阅读(109) 评论(0) 推荐(0)
摘要:1.使用全局的JSON对象,代码如下:function strToJson(str){return JSON.parse(str);} 2.new Function形式,代码如下function strToJson(str){var json = (new Function("return " + ... 阅读全文
posted @ 2014-12-10 11:35 JasonGu0 阅读(270) 评论(0) 推荐(0)
摘要:源自:http://www.cnblogs.com/chenlulouis/archive/2012/07/24/2607472.html1.2.以右键选择XML编辑器打开报表文件自定义扩展报表数据集的可绑定字段3.4.注意,最后在提供数据源的sql中要包括上面设计报表中所有的绑定字段说白了就是自定... 阅读全文
posted @ 2014-06-11 12:44 JasonGu0 阅读(162) 评论(0) 推荐(0)
摘要:链接:http://www.cnblogs.com/oec2003/archive/2010/01/06/1640027.html 阅读全文
posted @ 2014-05-19 14:14 JasonGu0 阅读(179) 评论(0) 推荐(0)
摘要:input控件 js代码 function time() { var q7 = document.getElementById("t1"); var d = new Date(); q7.value = d.toLocaleDateString()+" "+d.toLocaleTimeString(); setInterval (time,1000) } 阅读全文
posted @ 2013-08-02 14:04 JasonGu0 阅读(272) 评论(0) 推荐(0)
摘要:input控件 是 否 js代码 function cc1() { var q4 = document.getElementById("r1"); var q5 = document.getElementById("r2"); var q6 = document.getElementById("s1"); if (q4.checked == true) { q6.style.display = "block"; } ... 阅读全文
posted @ 2013-08-02 14:02 JasonGu0 阅读(692) 评论(0) 推荐(0)
摘要:input控件 单价数量总价js代码 function count() { var q1 = document.getElementById("b").value; var q2 = document.getElementById("b1").value; var money = q1 * q2; var q3 = document.getElementById("b2"); q3.value = money; } 阅读全文
posted @ 2013-08-02 13:59 JasonGu0 阅读(403) 评论(0) 推荐(0)
摘要:inpupt控件 js代码 function yz() { var q8 = document.getElementById("yy1"); var q9 = document.getElementById("sp"); var t = parseInt(q8.value); if (isNaN(t) == true) { q9.innerHTML="不是整数"; } else { ... 阅读全文
posted @ 2013-08-02 13:58 JasonGu0 阅读(562) 评论(0) 推荐(0)