gpt4 book ai didi

javascript - jquery文件上传抛出错误

转载 作者:数据小太阳 更新时间:2023-10-29 04:22:35 24 4
gpt4 key购买 nike

我有一个 ASP.NET MVC 应用程序。由于应用程序中有其他 jQuery 插件,此应用程序需要 jQuery 2.1。我正在尝试为我的用户提供一种上传图片的方式。为了做到这一点,我正在查看 jQuery file uploader .我的 JavaScript 看起来像这样:

$('#userPicture').fileupload({
dataType: 'json',
done: function (e, data) {
}
});

userPicture 标记如下所示:

<input id="userPicture" type="file" name="userPicture" data-url="/pictures/User/@ViewBag.UserId">

页面最初加载时没有任何错误。但是,当我选择图片时,我收到一条错误消息:

Uncaught Error: no such method 'process' for fileupload widget instance       jquery-2.1.1.js:250

不显示图像预览。如何通过适用于 IE 8+ 的 JQuery 插件选择图片并显示客户端预览

最佳答案

我在 Chrome 上遇到了同样的问题,在我的例子中,问题似乎是缺少 jquery 插件“jquery.fileupload-process.js”,正如@jevgenig 在他的评论中提到的那样。希望这可以帮助某人

关于javascript - jquery文件上传抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26107575/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com