jQuery事件处理程序:Object [Object Object]没有方法'getUploads'
getting an error - Caught error in Fine Uploader jQuery event handler: Object [object Object] has no method 'getUploads'
更新此问题
我遇到的问题是试图获得使用getUploads API提交的作业数量。
当我调用函数时,我总是得到0(0)。
不确定我做错了什么。马特
<script>
// Wait until the DOM is 'ready'
$(document).ready(function () {
var myUploader = $("#fine-uploader").fineUploader({
session: {
endpoint: 'imageStatus.cfm',
params : {transaction_id : <cfoutput>#client.transaction_id#</cfoutput>}
},
debug: true,
request: {
endpoint: 'upload.cfm',
params : {details : "<cfoutput>#client.wallfolder#|#client.DonatorID#|#client.wallid#|#client.transaction_id#|#client.clientid#</cfoutput>"}
},
validation: {
itemLimit: <cfoutput>#evaluate(client.numberofbricks*3)#</cfoutput>,
allowedExtensions: ["jpeg", "jpg", "gif" , "png"],
sizeLimit: 5000000 // 5 MiB
},
messages: {
tooManyItemsError: 'You can only add <cfoutput>#client.numberofbricks#</cfoutput> images'
},
deleteFile: {
enabled: true, // defaults to false
endpoint: 'upload_delete.cfm',
method: 'post',
params : {wallid : "<cfoutput>#client.wallid#</cfoutput>"}
},
retry: {
enableAuto: false
},
scaling: {
sendOriginal: true,
hideScaled: true,
sizes: [
{name: "THUMB_XX", maxSize: 113},
{name: "FULLIMAGE", maxSize: 450}
]
}
})
.on('allComplete', function(responseJSON) {
if (qq.status.UPLOAD_SUCCESSFUL == 'upload successful') {
//get uuid for message
if ($(this).fineUploader("getNetUploads") > 0){
$("#ContinueButton").show();
}else{
$("#ContinueButton").hide();
};
}
})//on
.on('sessionRequestComplete', function(event, id, fileName, responseJSON) {
if ($(this).fineUploader("getNetUploads") > 0){
$("#ContinueButton").show();
};
})//on
.on('deleteComplete', function(event, id, fileName, responseJSON) {
if ($(this).fineUploader("getNetUploads") == 0){
$("#ContinueButton").hide();
};
var submittedFileCount = myUploader.fineUploader("getUploads", {status: qq.status.SUBMITTED});
alert(submittedFileCount);
});//on
$('#ContinueButton').click(function() {
var submittedFileCount = $('#myUploader').fineUploader('getUploads').length
alert(submittedFileCount);
});
}); //close of top script - required
我猜myUploader
是由$("#uploader-container").fineUploader({...});
返回的值,这是一个jQuery对象。在这种情况下,您试图在jQuery对象上调用getUploads
,这当然不会起作用。
如果您想在使用jQuery包装器时对插件进行此调用,您需要这样做:
myUploader.fineUploader("getUploads", {status: qq.status.SUBMITTED});
下面是一个使用jQuery上传器在onAllComplete
处理程序中使用getNetUploads
的示例:
.on("allComplete", function(responseJSON) {
console.log("allComplete");
if ($(this).fineUploader("getNetUploads") > 0) {
console.log("#ContinueButton.show()");
//$("#ContinueButton").show();
}
else {
console.log("#ContinueButton.hide()");
//$("#ContinueButton").hide();
};
var submittedFileCount = $(this).fineUploader(
"getUploads", {
status: qq.status.SUBMITTED
});
alert(submittedFileCount);
})
我明白了。问题在于电话的过滤。我已经提交了,应该是qq.status。UPLOAD_SUCCESSFUL
相关文章:
- Android/Javascript:Uncaught TypeError Object[Object]没有方法'
- angular ui下拉切换[object object]没有方法父级
- jqxGrid失败并出现错误“;Object[Object Object]没有方法'jqGrid'&”;
- 未捕获的类型错误:Object[Object Object]没有方法'fancybox'
- javascript中的Object.create方法
- jQuery令牌输入轨道获取错误Uncaught TypeError:Object[Object Object]没有方法
- 为什么dijit.form.Select有方法setStore(),而dijit.fform.FilteringSele
- 重写JavaScript中的Object.create方法
- 未捕获的类型错误:Object[Object Object]没有方法'滑块'
- jquery autocomplete组合框错误:未捕获类型错误:Object[Object Object]没有方法
- JQuery Object[Object Object]没有方法'滑块'当尝试使用滑块演示时
- jquery Object 没有方法 'xyz'
- Javascript TypeError: Object 没有方法
- Object.Prototype 方法和 IIFE(立即调用的函数表达式)中的“use strict”
- 使用 $().trigger() 并获取 TypeError: Object [object Object] 没有方法“
- SAPUI5 setTimeout() --> Object 没有方法
- 创建一个具有 3 个方法的 JavaScript 对象抛出 Object 没有方法
- Jquery:Uncatch TypeError:Object #
- Azure 节点.js脚本:TypeError:Object #
没有方法“toQueryObject” - jQuery uncatch TypeError Object 没有方法