`
sohighthesky
  • 浏览: 34837 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
文章列表
不计算小时: /* *reg生日 *tod当前日期,从服务器获取 *cd提前提醒的天数范围 */ function getBirthday(reg,tod,cd){ var d=new Date(reg),n=new Date(tod),y=n.getFullYear(), yd=new Date(y,n.getMonth(),n.getDate()), ds=(new Date(y,d.getMonth(),d.getDate())-yd)/(1000*60*60*24),//月日份相差天数 ys=n.getFullYear()-d.g ...
在外国一博客看到一个很好的 function parseURL(url) {     var a =  document.createElement('a');     a.href = url;     return {         source: url,         protocol: a.protocol.replace(':',''),
<!doctype html> <html> <head> <meta charset="utf-8"/> <title>Online and offline events</title> </head> <body> <div id="status"><p id="state"></p></div> <div id="log& ...
firefox3.6新增(目前2010-6-5貌似没有其它浏览器支持)HTMLElement.classList属性 方便 了对class样式的操作 <div class="a c" id="test">test</div> var test=document.getElementById("test"); if('classList' in test){ var cl=test.classList; document.write(typeof(cl));//object ...
public static DataTable GetExcelTable(string excelFilename) { string connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Jet OLEDB:Engine Type=35;Extended Properties=Excel 8.0;Persist Security Info=False",excelFilename); DataSet ds = new DataSet(); ...

parseInt

alert(parseInt(0.000001)); alert(parseInt(0.0000001)); 原因: alert(0.000001); alert(0.0000001); 说明: ECMA-262 规范,parseInt 会先调用 toString 方法。对于小于 1e-6 的数值来说,ToString 时会自动转换为科学计数法。
function b(x, y, a) { a = 10; alert(arguments[2] );//chrome bug(chrome 5.0.369) } b(1, 2); 在FF3.6之前.发现了怪异的后门.应该是开发者测试用的... 查了各种文档,没发现记载,可能是非正式属性 分别对应于正则表达式对象的6个属性 -1 : source -2 : global -3 : ignoreCase -4 : lastIndex -5 : multiline -6 : sticky 比如 /a/[-2] 相当于 (/a/).global doc ...
pad1: function pad(num, n) { return (Math.pow(10,n)+num+'').substr(1); //缺点:位数长度有限,15位以内。 } alert(pad(3,6)); pad2: function pad(num, n) { y='00000000000000000000000000000'+num; //爱几个0就几个,自己够用就行 return y.substr(y.length-n); } alert(pad(3,6)); pad3: String.prototype.padLeft=function( ...
在IE Tester V0.4.1 IE6/+,Firefox3.5,Chrome3.0,Opera 9.64以及Safari4.0.3下测试通过 点击运行示例 代码: (默认页面加载10秒后显示,显示30秒后自动隐藏,可自定义配置) 09-12-5: 修改图片文件,将几个背景放到一个图片文件里,并可切换两种样式风格 ,即qq的蓝色和红色 下载示例源码 /* *Author:sohighthesky *From:http://www.cnblogs.com/sohighthesky/ *Date:2009-11-9 */ /* *box 指定要显示消息框或者其 ...
在论坛中看到有人提到 这个功能,感觉应该能实现,周末就抽时间写出来了,在这里分享下: 思路:Hook+SendMessage, 首先,因为我们要改的键war3不是自己写的程序,所以只能用Hook来监控键盘的按键: 键盘Hook: using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace quickey { public class KeyboardHook { private const int WM_KEYDOW ...
Global site tag (gtag.js) - Google Analytics