无法处理 fineUploader Plugin 提供的功能,
can't deal with the functions provided in fineUploader Plugin ,
以下3个功能没用
/*getFile(id); => 这是第二个 */
/* getEndpoint(id); => 这是第三个 */
/* uploadStoredFiles(); => 这是第一个 */
那么代码怎么了?
<script>
var uploader = new qq.FineUploader({
debug: true,
element: document.getElementById('fine-uploader'),
request: {
endpoint: "endpoint.php"
},
chunking: {
enabled: true,
concurrent: {
enabled: true
},
success: {
endpoint: "endpoint.php?done"
}
},
deleteFile: {
enabled: true,
endpoint: "endpoint.php"
},
retry: {
enableAuto: true,
showButton: true
},
autoUpload:false,
上传存储文件(); /* => 这是第一个 */
callbacks: {
onError: function(id, name, errorReason, xhrOrXdr) {
alert(qq.format("Error on file number {} - {}. Reason: {}", id, name, errorReason));
},
onComplete:function(id,name,responseJSON,xhr){
alert(getFile(id)); /* => here's the second */
alert(getEndpoint(id)); /* => here's the third */
}
},
</script>
fine uploader在调用方式上没有什么特别之处。与任何对象一样,您必须在实际对象上调用特定于对象的方法。方法不会神奇地为您添加到全局范围。
在回调处理程序之外,您必须在上传程序的实例上调用这些方法。在您的情况下(因为您已经将构造的实例分配给名为 uploader
的变量):uploader.uploadStoredFiles()
.
在回调处理程序(例如 onComplete
)中,您可以调用 this
上的方法,例如:this.getFile(id)
.
以下3个功能没用
/*getFile(id); => 这是第二个 */
/* getEndpoint(id); => 这是第三个 */
/* uploadStoredFiles(); => 这是第一个 */ 那么代码怎么了?
<script> var uploader = new qq.FineUploader({ debug: true, element: document.getElementById('fine-uploader'), request: { endpoint: "endpoint.php" }, chunking: { enabled: true, concurrent: { enabled: true }, success: { endpoint: "endpoint.php?done" } }, deleteFile: { enabled: true, endpoint: "endpoint.php" }, retry: { enableAuto: true, showButton: true }, autoUpload:false,
上传存储文件(); /* => 这是第一个 */
callbacks: { onError: function(id, name, errorReason, xhrOrXdr) { alert(qq.format("Error on file number {} - {}. Reason: {}", id, name, errorReason)); }, onComplete:function(id,name,responseJSON,xhr){ alert(getFile(id)); /* => here's the second */ alert(getEndpoint(id)); /* => here's the third */ } }, </script>
fine uploader在调用方式上没有什么特别之处。与任何对象一样,您必须在实际对象上调用特定于对象的方法。方法不会神奇地为您添加到全局范围。
在回调处理程序之外,您必须在上传程序的实例上调用这些方法。在您的情况下(因为您已经将构造的实例分配给名为 uploader
的变量):uploader.uploadStoredFiles()
.
在回调处理程序(例如 onComplete
)中,您可以调用 this
上的方法,例如:this.getFile(id)
.