2012年12月24日 星期一

select element auto resize after appending options with jQuery in IE

在 IE 底下 select 元素如果在 css 中用百分比設定寬高時
用 jQuery 的 append method 為它加上 option 後它會自動 resize
剛好網路上有人討論這個問題
Appending options to a select, using jQuery, resizes it?

看起來是因為用百分比設定寬高的緣故 如果用 px 去設定寬高就不會有這個現象了

看來是 jQuery 的 append 作了一些事情跟 IE 衝到
如果一定要用百分比設定寬高 就不要用 append method
自己用 DOM select 元素的 add method 吧

2012年12月3日 星期一

vim 的 fileencoding ,encoding 和 termencding

encoding:
影響 vim 內部 buffer, register, 如果是 gvim 這個值也代表顯示到螢幕上的編碼
正常情況下該值應該要是系統的 locale

fileencoding:
代表文件在硬碟中所使用的編碼, 它會影響到我們寫入這個文件時所用的編碼
如果這個值跟 encoding 不一樣, vim 會自動在內部作轉換

termencoding:
代表螢幕顯示所用的編碼

reference:
http://blah.blogsome.com/2007/08/23/vim_cn_faq/