星期三, 10月 19, 2011

[jQuery Plugin] jQuery File Upload FAQ

這篇主要記錄自已使用jQuery File Upload的一些問題,如果要基本的使用方法請參考這篇:


Q1: 上傳成功時發生Empty file upload result的情況
A1:V5 的伺服端接收上傳成功的訊息後,需回傳一個JSON Array,即時只有一個上傳檔案。例如:{["uploadfilename":"helloworld.jg"]}

Q2:使用Jsp無法順利jQuery樣版無法順利套用
A2:解法在這篇討論

Uploaded filename and size is not displayed in JSP???
The plugin template use the same syntax of Expression Language (EL) used by jsp and so ${name} and ${sizef} variables are evaluated in jsp and replaced with "" and "" . To avoid this you have to replace ${name} and ${sizef} with ${"${name}"} ${"${sizef}"}.

Q3: Firefox 4 fails when uploading empty file

 can confirm this issue with the basic File Upload plugin and Firefox 5.
However this seems to be a bug in the implementation of the FormData/XHR implementation of Firefox/Gecko.
Feel free to submit a bug report here: https://bugzilla.mozilla.org
IE跟Chrome上傳0KB檔案都是正常的。

Q4: How to cancel upload queues?
 $("#yourbutton").click(function (e) {
  //invoking a click event on all the upload row cancel buttons.
  $(".cancel button").click();
 });

星期二, 10月 04, 2011

[jQuery Plugin] jQuery Templates 樣版

由於AJAX技術愈來愈多人使用,搭配回傳的JSON格式產生UI已經是非常普遍的做法,
但如果搭配樣版的觀念來動態Bind資料,想必是更省事,最近使用的jQuery-File-Upload元件,
也使用樣版來產生UI。

以下是一些學習連結:
jQuery Templates Plugin筆記1by黑暗執行緒 

[JSP] JSP頁面引用bigd-5編碼的Javascript

想不到也有人遇到過同樣的問題XD~


Reference:[Tips] 在 utf-8 頁面 使用 big5 的 Javascript 檔之前在上線網站的時候, Clark 遇到在 utf-8 的網頁下要include big5 的 js 的問題,當時出現的問題是由於big5 的 js 檔中有中文字,include 到 utf-8 的 page 上時就造成 javascript error 或文字變成亂碼,當時趕著上線,所以就選擇將原來的 js 另存一份成為 utf-8 格式的 js 。就這樣使用了到現在將近一年,最近正在改這個 js 檔時發現為什麼不延用一份共用的 js ,而去另外自已建一份呢?一測試之下終於回想到當初的原因。由於在這陣子 Clark 也處理過類似問題,得到的結論是,在語法中下 charset="big5" 就可以讓 browser 不依照該 page 的 encoding 去做解譯,所以顯示的結果就正常了!

經過修改,顯示一切正常,其他Browser也沒有發現問題,上線!

星期一, 10月 03, 2011

[Tomcat] Linux系列關掉所有java程式後啟動tomcat流程

本篇記綠同事的流程XD

//首先砍掉所有運行的java程式
>pkill -9 java

//查詢java的程序還在不在,有的話會列process id。
>pgrep java

//使用替代pgrep java類似的指令
>ps aus | grep java

//開啟tomcat
>./startup.sh

其他你感興趣的文章

Related Posts with Thumbnails