2007-06-07

在页面上增加快捷键的支持

关键字: javascript
在Reader项目中需要加上上下item的快捷键支持。 现在贴下使用到的代码。。 你可以把事件onkeyup写在body中, <body onkeyup="connectShortKey()" /> 如果动态attache的话 是不是用document.body.onkeyup== fucntion(){}的, 你需要把时间attach到document上。 另外 在firefox 和 ie下取onkeyup事件的keyCode是不一样的。如下。。。 dojo.addOnLoad(function(){ document.onkeyup=function(event) ...
在做web开发时,特别是现在ajax系统,需要写大量的javascript脚本。而我们也需要刷新页面去看或者调式是不是我们写的这段javascript正确。我们经常遇到的情况是刷新之后。发现javascript根本不是我们期望的结构,在浏览器中output我们javascript file,然后我们发现根本没有更新javascript file。 javascript文件本浏览器cache了。我经常做的就是使用firefox的web develop toolbar去disable cache。 在开发环境可能还不会造成太大的麻烦,如果是在生产环境的话,客户可能会急着打电话责问你,为什么我们新版 ...
大家应该都知道jscalendar这个日期选择框吧。 当在yui-ext中的dialog使用时,大家应该会想到会发生什么吧。日期选择框在变灰的背景后面。如下图: 大家都应该知道引起这个问题的原因是dialog的z-index比日期选择框的大。ok。我们只要让日期选择框的z-index比dialog还要大就ok。。 修改 calendar.js代码。 让在创建日期选择框的div时加上z-index属性. Calendar.prototype.create = function (_par) { var parent = null; if (! _par) { // def ...
2007-04-03

Javascript中的this.

关键字: hitch
Javascript中的this跟Java中的this不一样,可能在创建对象的时候是一样的,但是当运行的时候,可能javascript中的this,可能就会变成另外一个对象。如果不熟悉javascript编程的人遇到这种情况时,很有可能会觉得莫名其妙。怎么定义的函数或者属性总是undefined呢? //@parm timeout_time if user is not active for the time, we will consider the user should be away and should make time r ...
假如我们有这个一个页面,  index.html     <br>  <body><br>  <p>This page uses frames, but your browser doesn&apost support them.</p><br>  </body><br>  Toc.html是目录页面, Content.html是内容页面。      ...
Thanks the following codes. while in Firefox, you just need to invoke textElement.focus() method.So here is how to position the caret end the end of a text field/textarea with IE4/5:function setCaretToEnd (el) { if (el.createTextRange) { var v = el.value; var r = el.createTextRange(); r.mo ...
本来打算写篇关于javascript继承的文章, 但是觉得这篇文章已经写得够好了。 http://forum.javaeye.com/viewtopic.php?t=19748
dengyin2000
搜索本博客
我的相册
4d063000-8eef-365d-8346-f210ccfd5265-thumb
VB-seamless
共 13 张
存档
最新评论