By Poyu, on 三月 5th, 2012
.click( [eventData], handler(eventObject) ) eventDataA map of data that will be passed to the event handler. handler(eventObject)A function to execute each time the event is triggered.
傳遞當下的全域變數給bind的匿名函數 以jquery .click() 為例
for(var i in arrayA){ $("#"+id[i]).css(‘cursor’,'pointer’).click({a: i},function(event){ gofuntion(event.data.a); }); }
http://s.yanghao.org/program/viewdetail.php?i=230515
By Poyu, on 十一月 13th, 2011
遇到檔名中文問題
發生錯誤的原因在於中文版的Windows是用Big5在編碼,但是網頁送過來的卻可能是UTF8的資料,所以終極的解決方法是到Server端後將UTF8的檔名轉換成Big5的檔名,最後再依照轉換過的檔名來儲存檔案就好了。
注意 mb_convert_encoding 是否有安裝於php
$file=mb_convert_encoding($_FILES["file"]["name"],"big5″,"utf8″); copy($_FILES["file"]["tmp_name"],"upload/".$file);
http://blog.riaproject.com/php-mysql/238.html
By Poyu, on 十一月 13th, 2011
使用iconv要把Big5轉到utf8時,iconv遇到無法轉的字後就不轉,所以該字以後都掉字
解法1: 改用 mb_convert_encoding [string] iconv(‘來源編碼格式’, ‘目標編碼格式’, "輸入的文字資料") [string] mb_convert_encoding("輸入的文字資料", ‘目標編碼格式’, ‘來源編碼格式’)
http://www.ps3w.net/modules/psbb/?op=openthr&pos_id=1101
解法2: 以逐字轉解決 將無法轉的字以?取代
function big52utf8($big5str) {
$blen = strlen($big5str); $utf8str = "";
for($i=0; $i 128 && $sbit < 255) { $new_word = iconv("BIG5″, "UTF-8″, substr($big5str,$i,2)); $utf8str.=($new_word=="")?"?":$new_word; $i++; } }
return $utf8str;
}// end func
. . . → Read More: php iconv
By Poyu, on 十一月 11th, 2011
if(B)this.dV() -> if(!B)this.dV()
P.mj=I P.mj=J -> P.mj=""
By Poyu, on 十一月 4th, 2011
GNOME的NetworkManager"裝置無法管理" ifconfig or NetworkManager 只能二選一 若要用 ifconfig 來設定網路,那在 /etc/network/interfaces 裡就會有:
auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet dhcp wireless-essid myap
若這樣,NetworkManager 就不會去管 eth0 eth1 這兩張網卡了
因此,若你想要讓 eth1 這張無線網卡交給 NetworkManager 來管理 就要把 eth1 的部份註解掉
#auto eth1 #iface eth1 inet dhcp #wireless-essid myap
http://blog.candyz.org/20060629/1241
ubuntu伺服器LAMP安裝+Xwindow
http://itworker.blogspot.com/2006/10/ubuntulampxwindow.html