Last week, I had interviewed by IThome periodical talking about what's different in IE 8.
Here is the complete content (Chinese only)
2009/04/18
2008/05/07
A Tricky Level of HTML Tag

This illustration is a level of HTML tag when you wanna manipulate them between each other to show the correct layout. Especially in IE6, when you develop a drag-drop Javascript code, you should find that the overlapped Div is placed under the Select tag (a drop-down list), even using the z-index CSS. Fortunately, the issue is only caused by IE6, and a solution is appeared that the Iframe tag is higher than the Select tag so we can use a empty Iframe to apply to the Select, then use the overlaped Div over the Iframe to resolve this issue. This way can also cope with a dragging event lost, when the action is over the Iframe.
2008/03/08
ZK 3.0.4 Come
What's important in this version?
If you have used the ZK 3.0.x version, you might find that the performance of
Fortunately, we found a way how to sovle this bottleneck is need to shift a little structure of the Dom of these components. After we modified, we gain that the performance is many times faster than ZK 3.0.3.
If you have used the ZK 3.0.x version, you might find that the performance of
Grid/Listbox/Tree
with a large data(like many rows) is a sort of unacceptable, which ZK client engine needs to calculate the width of each cell. Especially in FF, even if ZK client engine just assigns a normal size to the TD
tag of a single row in a big Dom tree(like table), the computing time of FF still takes more time than IE after we optimized the Javascript code.Fortunately, we found a way how to sovle this bottleneck is need to shift a little structure of the Dom of these components. After we modified, we gain that the performance is many times faster than ZK 3.0.3.
2007/03/25
ZK-SimplyAjax跟我的機緣
去年的Java2後,有聽同事分享到zk的Ajax Framework,不過我倒是沒去聽內容(太忙了)。
不過等到今年初的新案子需要用到完整的Ajax Framework來輔助我們這個案子的前端架構,又讓我思考了zk的可用性(因有比較過),不知不覺也準備加入這個zk project team,說來說去不知道是不是真的有緣。
現在zk也算是OOS(OpenSourceSoftware)裡很活躍的Porject,因為每天都有人去post問題,當然這Project的管理人也是很熱心的每天幫忙大家回答問題。
不過等到今年初的新案子需要用到完整的Ajax Framework來輔助我們這個案子的前端架構,又讓我思考了zk的可用性(因有比較過),不知不覺也準備加入這個zk project team,說來說去不知道是不是真的有緣。
現在zk也算是OOS(OpenSourceSoftware)裡很活躍的Porject,因為每天都有人去post問題,當然這Project的管理人也是很熱心的每天幫忙大家回答問題。
2006/12/29
2006/10/25
如何清除Javascript Array物件的方法
原來,javascript可能取不到prototype的this物件,因此在實作Array.prototype時,只能用
this.length = 0;來改變原本物件的index,目前只能用這樣來解決。
this.length = 0;來改變原本物件的index,目前只能用這樣來解決。
Javascript 跟 ASCII 轉換
// javascript 的charCodeAt 是取得字串的ASCII編碼
String.charCodeAt();
//num 為十進位的ASCII編碼,此formCharCode將取得對應ASCII的字串
String.fromCharCode(num);
String.charCodeAt();
//num 為十進位的ASCII編碼,此formCharCode將取得對應ASCII的字串
String.fromCharCode(num);
2006/10/17
如何計算JavaScript字元的長度
當內容有中文時,字體的寬度會佔顯示的二個位元。
String.prototype.getLength = function() {
// 先找出佔二位元的字體(例如:中文)
var zh = this.match(/[^\x00-\xff]/ig);
// this.length + match到的字元個數(意思就是中文字會算二次)
return this.length + (zh == null ? 0 : zh.length);
}
使用的方式:
function test(){
var src = "1234五";
alert(src.getLength());
}
結果會出現 : 6
String.prototype.getLength = function() {
// 先找出佔二位元的字體(例如:中文)
var zh = this.match(/[^\x00-\xff]/ig);
// this.length + match到的字元個數(意思就是中文字會算二次)
return this.length + (zh == null ? 0 : zh.length);
}
使用的方式:
function test(){
var src = "1234五";
alert(src.getLength());
}
結果會出現 : 6
如何取得游標的位置?
Mozillar取得的方式:
- object.selectionStart;
- object.selectionEnd;
- // object就是textarea的物件
- this.object.focus();
- var range = document.selection.createRange();
- var stored_range = range.duplicate();
- stored_range.moveToElementText(this.object);
- stored_range.setEndPoint('EndToEnd', range);
- // 此selectionStart就是游標的起點
- this.object.selectionStart = stored_range.text.length - range.text.length;
- // 此selectionEnd就是游標的終點
- this.object.selectionEnd = this.object.selectionStart + range.text.length;
2006/10/14
如何取得javascript Textarea 反白的字元
取得所選取的文字
var range = document.selection.createRange();
複製
var temp=range.duplicate();
設定選取的長度為:4
range.moveStart('character',4);
設定結束點的位置,從temp的字元開始
range.setEndPoint("StartToStart",temp);
將所設定的字元長度選取反白
range.select();
2006/10/04
Signed Applet key tool
JAVA SECURITY 中的 KEYTOOL
執行方式: 用命令提示列直接下keytool的指令
key的產生過程如下:
執行方式: 用命令提示列直接下keytool的指令
key的產生過程如下:
- 產生key指令 keytool -genkey (預設key名為mykey) keytool -genkey -alias [名稱] (指定key的名稱)
- 察看key keytool -list
- 匯出key keytool -export -alias [key名稱] -file [檔名.crt]
- 在jar檔簽個章 jarsigner [檔名.jar] [key名稱]
- jarsigner -verbose -verify [檔名.jar ] [key名稱] (檢示detail)
BT 下載時造成 IE 、MSN都不能連線
作業系統為:Windows XP Service Pack 2
問題:Windows 為了防止 Worms 的攻擊,將 TCP/IP 連線數預設為10,BT下載時的連線數預設也是10 ,所以網路連線數已滿,因此IE、MSN要透過網路來連線時已經沒有可用的連線數。
解決方式:下載http://www.lvllord.de/?lang=en&url=downloads EvID4226Patch223d-en.zip,
此 patch 執行檔可修改windows的連線數限制,執行軟體便會出現幫你更改電腦的 TCP/IP 連線數為 50的畫面,只要按下『Y』即可,TCP/IP 連線數便會更改成 50 了,重新開機一次,執行BT下載軟體,在開IE、MSN做測試,此時,連線問題應該解決了。
加強版: 若50個TCP/IP 連線數還不夠,這個軟體還有個進階功能,但需要到命令提示字元下去執行該軟體,輸入該軟體的檔案名稱後面再加上 /?,便會出現進階功能的使用說明,/L=500 連線數就變500了。
NOTE: Window 檔案保護 視窗要求放入XP SP2 CD 請按取消鈕略過 。
問題:Windows 為了防止 Worms 的攻擊,將 TCP/IP 連線數預設為10,BT下載時的連線數預設也是10 ,所以網路連線數已滿,因此IE、MSN要透過網路來連線時已經沒有可用的連線數。
解決方式:下載http://www.lvllord.de/?lang=en&url=downloads EvID4226Patch223d-en.zip,
此 patch 執行檔可修改windows的連線數限制,執行軟體便會出現幫你更改電腦的 TCP/IP 連線數為 50的畫面,只要按下『Y』即可,TCP/IP 連線數便會更改成 50 了,重新開機一次,執行BT下載軟體,在開IE、MSN做測試,此時,連線問題應該解決了。
加強版: 若50個TCP/IP 連線數還不夠,這個軟體還有個進階功能,但需要到命令提示字元下去執行該軟體,輸入該軟體的檔案名稱後面再加上 /?,便會出現進階功能的使用說明,/L=500 連線數就變500了。
NOTE: Window 檔案保護 視窗要求放入XP SP2 CD 請按取消鈕略過 。
2006/10/03
第一次用Google Blogger就出現IE小bug
在blogger的檢視Blog裡,居然是白畫面,但經過FireFox使用並沒有任何問題。
原因出在:範本--> <$BlogMetaData$>
只要把 <$BlogMetaData$> 放到 <table><$BlogPageTitle> </table>的前面,就可以解決IE檢視的問題了。
問題就是編碼,Blogger都是用utf-8來編碼,但是中文的title會造成它編碼後認定網頁的編碼不符合,而造成白畫面。
原因出在:範本--> <$BlogMetaData$>
只要把 <$BlogMetaData$> 放到 <table><$BlogPageTitle> </table>的前面,就可以解決IE檢視的問題了。
問題就是編碼,Blogger都是用utf-8來編碼,但是中文的title會造成它編碼後認定網頁的編碼不符合,而造成白畫面。
Subscribe to:
Posts (Atom)