简体   繁体   English

未捕获的类型错误:$(...).find(...).not(...).size 不是 function

[英]Uncaught TypeError: $(…).find(…).not(…).size is not a function

I am using uploadify to upload file in laravel with progressbar implementation.我正在使用uploadify在 laravel 中使用进度条实现上传文件。 but when I am uploading file, I am getting this error in console.但是当我上传文件时,我在控制台中收到此错误。

Uncaught TypeError: $(...).find(...).not(...).size is not a function
    at HTMLInputElement.<anonymous> (jquery.uploadifive.js:814)
    at Function.each (jquery-3.5.1.min.js:2)
    at S.fn.init.each (jquery-3.5.1.min.js:2)
    at S.fn.init.upload (jquery.uploadifive.js:770)
    at S.fn.init.$.fn.uploadifive (jquery.uploadifive.js:872)
    at <anonymous>:1:19

I am using laravel and the blade view is我正在使用 laravel 刀片视图是
uploadForm.blade.php上传Form.blade.php

@extends('layouts.artist')
@section('content')
<div id="queue"></div>
    <input id="file_upload" name="file_upload" type="file" multiple="true">
    <a style="position: relative; top: 8px;" href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>
@endsection

@section('script')
<script type="text/javascript">
        $(function() {
            $('#file_upload').uploadifive({
                'auto'             : false,
                'checkScript'      : '',
                'fileType'         : 'image/png',
                'formData'         : {
                                       '_token'     : "{{csrf_token()}}"
                                     },
                'queueID'          : 'queue',
                'uploadScript'     : "{{route('track.upload')}}",
                'onUploadComplete' : function(file, data) { console.log(data); }
            });
        });
    </script>
@endsection

and my controller is this我的 controller 是这个
TrackController.php TrackController.php

function upload(Request $request) {
    $title = rand(1000000, 9999999);
    $request->file_upload->storeAs('public/uploads', $title.'.png');
    $response = ['status' => 'ok', 'message' => $title.' successfully uploaded.'];
    return response()->json($response);
}

Any help is highly appreciated.非常感谢任何帮助。

The size() method was deprecated in jQuery 1.8 and removed entirely in 3.0 and higher. size()方法在 jQuery 1.8 中已弃用,并在 3.0 及更高版本中完全删除。 You should use length instead.您应该改用length

That call appears to be coming from the uploadifive() library you're using.该调用似乎来自您正在使用的uploadifive()库。 As such I would assume that library is very outdated.因此,我认为图书馆已经过时了。 I'd suggest finding an alternative.我建议寻找替代方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的类型错误:$(...).size 不是 function - Uncaught TypeError: $(...).size is not a function 未捕获的TypeError:$(...)。find(...)。hasClass(...)。show不是函数 - Uncaught TypeError: $(…).find(…).hasClass(…).show is not a function 未捕获的TypeError:lab.find不是函数 - Uncaught TypeError: lab.find is not a function jQuery查找:未捕获的TypeError:row.find不是函数 - Jquery find: Uncaught TypeError: row.find is not a function 未捕获的TypeError:函数不是函数 - Uncaught TypeError: Function is not a function 未捕获的TypeError: <function> 不是功能 - Uncaught TypeError: <function> is not a function 未被捕获的TypeError:$(…).find(…).once不是bootstrap / js / bootstrap.js中的函数吗? - Uncaught TypeError: $(…).find(…).once is not a function in bootstrap/js/bootstrap.js? 未被捕获的TypeError:DB.find不是React with Meteor 1.3中的函数 - Uncaught TypeError: DB.find is not a function in React with Meteor 1.3 javascript尚未捕获的TypeError:“)”。查找不是在页面刷新时用于保存选项卡选择的功能 - javascript uncaught TypeError: “)”.find is not a function for save tab selection on page refresh 未捕获的TypeError:$(...)。tabs不是函数 - Uncaught TypeError: $(…).tabs is not a function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM