2011年4月14日

摘要: 今天无聊在群里面看到了一道面试题:1functionf1()2{3alert("1");4}5functionf2()6{7alert("2");8}9varf3=f1.call;10f3.call(f2);输出结果是2,后来想了一下,实在是让我大感JS的有趣,我的理解也不一定是正确的,只是想说出来,望有高手指正:我是这么理解:call函数是Function.prototype里面的函数,他在f1.call的情况下能调用f1,所以他的实现应该至少可以类似于Function.prototype.call=function(thispointer,arg1, 阅读全文
posted @ 2011-04-14 01:45 井底之K 阅读(506) 评论(2) 推荐(0)

2011年3月30日

摘要: varFundamental={count:1};functionTest(){}Test.prototype=Fundamental;Test.prototype.increase=function(){this.count++;};vartest=newTest();console.log(test.count);vartest2=newTest();console.log(test2.count);test.increase();//test.count和test2.count的值各是多少 前天去面试遇到的一道题,面试的问题大概是当test.increase被调用时,test和test2 阅读全文
posted @ 2011-03-30 14:12 井底之K 阅读(446) 评论(3) 推荐(0)

2009年12月28日

摘要: horoscope做了有1周了,第一次的方案是用meta来控制输出的class,利用js来读取class的值判断是哪个layout,这样的坏处就是无法添加更多的layout。被否决了。接着的方案有2种,1种是用SlotGroup + Slot + InfoPath;还有就是就是纯粹的Slot + InfoPath。纯粹的InfoPath其实没啥好讲的,就是做InfoPath,把原来的library... 阅读全文
posted @ 2009-12-28 22:30 井底之K 阅读(222) 评论(0) 推荐(0)

2009年11月3日

摘要: updated on 2010.06.18之前写的这篇实在是有些肤浅,删了吧...这里更正一下1.在markup中利用onclick = function 是DOM Level 0 的event绑定的方式。<input id="myBtn" type="button" value="Click Me" onclick="alert("click!!!");" /> 这样的赋值方式其实就... 阅读全文
posted @ 2009-11-03 20:36 井底之K 阅读(572) 评论(0) 推荐(0)

导航