javascript jquery.fileupload.js:87 Uncaught TypeError: $.widget is not a function on jQuery-file-upload

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29739309/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 10:59:12  来源:igfitidea点击:

jquery.fileupload.js:87 Uncaught TypeError: $.widget is not a function on jQuery-file-upload

javascriptjqueryfile-uploadjquery-file-upload

提问by Kokizzu

I tried to use basicexample (source) for jquery-file-upload, files that I've included in my html are:

我尝试将基本示例(源代码)用于jquery-file-upload,我包含在我的 html 中的文件是:

jquery.js
bootstrap.css
bootstrap.js

jquery.fileupload.css
jquery.iframe-transport.js
jquery.fileupload.js

Is there anything else that I should include to properly use jquery-file-upload?

还有什么我应该包括的才能正确使用jquery-file-upload吗?

My app doesn't need to use jquery-ui. If jquery-uiis really a dependency to jquery-file-upload, is there any workaround to use it without jquery-ui?

我的应用程序不需要使用jquery-ui. 如果jquery-ui真的依赖于jquery-file-upload,是否有任何解决方法可以在没有的情况下使用它jquery-ui

回答by Kokizzu

Nevermind, I should have read thisfirst. Only jquery-ui.widget.jsrequired, not whole jquery-ui.

没关系,我应该先读这个。仅jquery-ui.widget.js需要,而不是整个jquery-ui.

回答by Artur Grigio

The order in which

其中的顺序

<script src="js/vendor/jquery.ui.widget.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>

are loaded also matters.

是否加载也很重要。

回答by sajjad

jquery.js
jquery.ui.widget.js
jquery.iframe-transport.js
jquery.fileupload.js

and finally

最后

$('#input').fileupload() // and U is lower case !!!!