无法使blueimp / jQuery.fileupload插件工作 [英] Unable to get blueimp/jQuery.fileupload plugin to work
问题描述
我尝试使用此jQuery插件进行跨域图片上传 jQuery.fileupload
Am trying use this jQuery plugin for cross domain image uploads jQuery.fileupload
我认为插件使用require.js,我已经包括,因为我使用它加载javascript代码为我的页面。
这个插件似乎不需要包含require.js,但是当我测试我的页面我得到
这个错误
I think the plugin uses require.js, which i have already included because i use it load javascript code for my page. The plugin doesnt seem to required that i include require.js, but when i test my page i get this error
未捕获错误:匿名的define()模块不匹配:function($,
undefined){
http://requirejs.org/docs/errors.html#mismatch
有人可以请我在右边方向
Can someone please point me in the right direction
推荐答案
您不需要使用Requirejs来使用jQuery文件上传。
You don't need to use Requirejs to use jQuery File Upload.
只需确保按正确的顺序添加必需文件:
Simply make sure you include the required files in the right order:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<script>
$(function () {
$('#fileupload').fileupload({
// your options
});
});
</script>
这篇关于无法使blueimp / jQuery.fileupload插件工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!