1. 程式人生 > >Jquery.ocupload 一鍵上傳技術方法引數詳解(中文翻譯)(一鍵上傳新手入門)

Jquery.ocupload 一鍵上傳技術方法引數詳解(中文翻譯)(一鍵上傳新手入門)

http://code.google.com/p/ocupload/ Jquery.ocupload 一鍵上傳官網重點內容
官方文件案例
Example
var myUpload = $(element).upload({
name: ‘file’,
action: ”,
enctype: ‘multipart/form-data’,
params: {},
autoSubmit: true,
onSubmit: function() {},
onComplete: function() {},
onSelect: function() {}
})

Jquery.ocupload 一鍵上傳技術方法引數(name,enctype,action,autoSubmit,params,onSubmit,onComplete,onSelect方法引數詳解,帶中文翻譯)
Options
Both of the functions accept an optional options object, which can contain any or all of the following (default value):
//檔案上傳的名字,預設值是file
* name: (“file”) The name of the file input form element.
//檔案提交的方式,預設值是multipart/form-data
* enctype: (“multipart/form-data”) The enctype attribute of the form, it is usually a good idea to leave this as default.
//檔案上傳的action,配置路徑
* action: (null) The form action attribute, the page that will do the processing on the server side.
//檔案輸入框發生變化時,自動提交,預設開啟自動提交,可在onSelect方法中設定autoSubmit=false
* autoSubmit: (true) If true the form will be submitted after the user selects a file (after the file browser closes).
//檔案上傳時的額外引數
* params: ({}) Additional paramaters to be sent with the file, creates a hidden form element using the key as the name of the form and the value as the value.
//提交時觸發的事件
* onSubmit: (null) The callback function called before submitting the form.
//檔案上傳後觸發的事件
* onComplete: (null) The callback function called after the action page loads.
//選中檔案時觸發的事件
* onSelect: (null) The callback function called after the user has selected a file.