12 2011 档案

摘要:var num = 0;var max = 10;function incrementNumber() {num++;//if the max has not been reached, set another timeoutif (num < max) {setTimeout(incrementNumber, 500);} else {alert(“Done”);}}setTimeout(incrementNumber, 500);如果用setInterval 可能出现 下次调用会在前一次调用前调用 (True intervals are rarely used in producti 阅读全文
posted @ 2011-12-28 14:55 火拳阿飞 阅读(252) 评论(0) 推荐(0)
摘要:首先是CreateXMLHttpRequest,IE有点另类,所以要判断function createXHR() { if (typeof XMLHttpRequest != "undefined") { return new XMLHttpRequest(); } else if (typeof ActiveXObject != "undefined") { if (typeof arguments.callee.activeXString != "string") { var versions = ["MSXML2.XM 阅读全文
posted @ 2011-12-23 13:35 火拳阿飞 阅读(274) 评论(0) 推荐(0)
摘要:一直对实例方法的内存如何分配有很大疑惑(通俗的讲就是实例方法在内存中有几份),找了很多资料,以下是一个比较令我满意的答案,记录下:方法 (Method) 是一种类型定义,所以,它被存放在 Type Object 上,Type Object 是一个被分配在托管堆上的特殊类型,在同一个 AppDomain 中,每一个类型,都对应一个全局的 Type Object。每个引用类型的实例,都包含一个指向它的直接类型的 Type Object 的指针,每个 Type Object 也存在类似的指针,用来标识它的直接父类型的 Type Object。当调用静态方法时,CLR 会根据方法调用去寻找其对应的 T 阅读全文
posted @ 2011-12-16 22:08 火拳阿飞 阅读(2601) 评论(5) 推荐(1)