显示标签为“Javascript”的博文。显示所有博文
显示标签为“Javascript”的博文。显示所有博文

20110222

An article about Named function expressions

In English: http://kangax.github.com/nfe/
In Chinese: http://www.cn-cuckoo.com/main/wp-content/uploads/2009/12/named-function-expressions-demystified.html#introduction

20100126

Get the view size not window size in ExtJS

If your browser window contain a vertical scrollbar, using Ext.getBody().getWidth() will get the body size with the width of vertical scrollbar.
Example, if the body is 800px. and vertical scroll bar is 50px, so the vew size is only 750px.
If you set width of a component to 800px, you will see a horizontal scrollbar.
So lets use Ext.getBody().getViewSize().width (see docs for detail). It will give us the width of the region you see.

20091218

使用eclipse及其他来编辑ExtJS的工程

虽然最后放弃了这种臃肿的办法,不过使用过确实发现了优点还是有一些的:

1. 高亮显示当前光标所在的变量的所有同一个变量myMask,然后所有myMask变量的背景都变成了lightyellow,省得去一个一个的搜索了,一目了然。

2. 自动完成,能够根据定义好的类找到相应的方法,比如fp是一个FormPanel,输入“fp.g”就会出现“fp.getForm()”等方法。

3. 自动找类或者方法定义的地方,比如按住ctrl键,鼠标放在任意一个调用fp的地方,然后指针变成了手形,就好像这个fp是一个链接一样,然后点击之后就能跳到fp定义的地方“var fp = new Ext.FormPanel({...”。

4. 还有就是Elipse里面一些好用的快捷键,比如多行复制“ctrl+alt+上或者下方向键”,多行上下移动“alt+上或者下方向键”,删除多行“ctrl+D”。这些在UE里面只能处理单行。

配置上没什么好说的,直接去下载或者在Eclipse中配置如下URL即可:
Aptana - http://update.aptana.com/install/studio
PDT - http://downloads.zend.com/pdt
Spket - http://www.spket.com/update/


20090402

解决 firefox 不支持 document.all的方法

2007/05/06 10:19

今天看到一段javascript,在firefox无法运行,于是使用firefox的错误控制台察看了一下有什么错误,发现了
这样的一条错误信息:"
document.all is not a function
"

在源程序中是这样的一句:"
document.all("college").length=0;
"

百度了一下才知道只有这是只有IE才听得懂的方言-- document.all
而且也就用来判断是否为IE浏览器啦。。。

最后换成了这样就可以使用了:“
document.getElementById("college").length=0;


/* =================================================================== */
网上的一些解决方案:
用 document.getElementsByTagName("*") 替代就OK了。
getElementsByTagName("*") 可以得到得到所有元素的集合
getElemntById 可以按id得到某一元素
getElementsByName 可以得到按name属性得到某一元素
注:来自 http://www.wulixuan.cn/post/27.html