简体   繁体   English

Javascript未捕获类型错误未定义不是函数

[英]Javascript Uncaught type error undefined is not a function

I am trying to include a video file upload feature on my website: 我正在尝试在我的网站上添加视频文件上传功能:

I am following the example as posted here: http://davidsonsousa.net/en/post/how-to-upload-a-file-using-mvc-3-and-ajax 我正在遵循此处发布的示例: http : //davidsonsousa.net/en/post/how-to-upload-a-file-using-mvc-3-and-ajax

I have included all the necessary libraries in my MVC project.. In my view I included the below header: 我已经在我的MVC项目中包括了所有必需的库。.在我看来,我包括以下标头:

<head>
    <title>Videos </title><!-- Bootstrap core CSS -->
        <link href="~/Scripts/jquery-lib/jquery.fileupload.css" rel="stylesheet" />
       <script src="/Scripts/jquery-lib/jquery-1.9.1.min.js" type="text/javascript"></script>

        <script src="/Scripts/jquery-lib/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-lib/bootstrap.min.js" type="text/javascript"></script>

    <script src="/Scripts/jquery-lib/jquery.fileupload.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $('#fileupload').fileupload({
                dataType: 'json',
                url: '/Videos/UploadVideoFile/?isrc=' + 'HGTGHTGTYTGT',
                autoUpload: true,
                done: function (e, data) {
                    $('.file_name').html(data.result.name);
                    $('.file_type').html(data.result.type);
                    $('.file_size').html(data.result.size);
                }
            }).on('fileuploadprogressall', function (e, data) {
                var progress = parseInt(data.loaded / data.total * 100, 10);
                $('.progress .progress-bar').css('width', progress + '%');
            });
        });
</script>
</head>

When I load my web page I get the following errors: 加载网页时,出现以下错误:

Uncaught type error undefined is not a function Which points to this section in the upload script: $('#fileupload').fileupload({ 未捕获的类型错误undefined不是指向上传脚本中此部分的函数:$('#fileupload')。fileupload({

I also get thee errors: 我也得到你的错误:

Uncaught TypeError: undefined is not a function add:96
Uncaught ReferenceError: jQuery is not defined jquery.ui.widget.js:18
Uncaught ReferenceError: jQuery is not defined bootstrap.min.js:6
Uncaught TypeError: Cannot read property 'support' of undefined jquery.fileupload.js:32
Uncaught ReferenceError: $ is not defined add:95
Uncaught TypeError: Cannot read property 'support' of undefined jquery.fileupload.js:32
Uncaught ReferenceError: $ is not defined

It seems like jQuery is not being loaded. 看来jQuery没有被加载。 Open your browser's debugger (F-12) and look at the NETWORK tab. 打开浏览器的调试器(F-12),然后查看“网络”选项卡。 Reload the page and look for a 404 error. 重新加载页面并查找404错误。 You likely have the wrong path. 您可能走错了路。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM