我正在使用一个预先制作的模板,并修改它为我的项目需要。查看控制台,我得到了许多错误,我不知道如何修复。它看起来是这样的:
Uncaught TypeError: $.widget is not a function
at jquery.fileupload.js:91
at jquery.fileupload.js:25
at jquery.fileupload.js:27
jquery.fileupload-image.js:46 Uncaught TypeError: Cannot read properties of undefined (reading '
我正在尝试在我的项目中使用blueimp的jQuery文件上传插件。这在Basic Plus版本中工作得很好,我可以在服务器上加载文件,但当我尝试使用Basic Plus UI ()时,我得到了错误:
tmpl.min.js:1 Uncaught TypeError: Cannot read property 'innerHTML' of null
at Function.n.load (http://127.0.0.1:8000/static/cp/file_upload/tmpl.min.js:1:324)
at n (http://127.0.0.1:80
我没有在我的应用程序上运行ajax jquery文件上传的机会,我的实现基于Ryan Bate的,尽管我使用的是剪纸夹而不是Carrierwave
在我的控制台中,我收到错误: ReferenceError: file is not defined
下面是airbrake的回溯,如果有帮助的话:
url/assets/styleitems.js?body=1:6 in "HTMLFormElement.$.fileupload.add"
url/assets/jquery-fileupload/vendor/jquery.ui.widget.js?body=1:490 in
在requirejs中,我们可以通过以下方式设置js的名称:
requirejs.config({
paths: {
'jquery': '//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js'
}
});
然后用它来形容:
requirejs(['jquery'],function ($) {
//loaded and can be used here now.
});
但是对于像fileupload这样的插件来说,需要一些js文件。他们的