2012年12月13日 星期四

解决image onload失效的方法

因為想要利用Javascript來調整圖片的大小,所以利用了onload,寫了以下code:

<img src="test.jpg" onload="checkImage" />

在firefox 下完全沒有問題,但在chrome 22 發現image的onload event在很多時候都不會被呼叫。

經過測試後發現改成以下寫法就沒問題了

<img onload="checkImage" src="test.jpg" />


推測是因為cache導致onload event還沒執行到,圖已經載完了。

2012年12月7日 星期五

530 User xxxxx may not use FTP, mac os server


我在Mountain lion server.app下建立一個新用戶(沒有家目錄),

並且妥當的設定了FTP文件夾的權限。

然而很不幸的,在ftp連線時總是得到以下錯誤回應:

'530 User <account> may not use FTP.'


解決辦法如下:

Server app -> Accounts -> Users ->在context menu選擇使用者

-> Advanced Options -> Login shell

->將Services only帳號預設的 /user/bin/false 改成 /bin/sh


530 User xxxxx may not use FTP, mac os server














大功告成!!