我正在为拖放文件的dropzone实现而苦苦挣扎。我正在开发的Smalltalk平台与Seaside在前端。目前,我可以上传文件,但在上传时看不到成功图标和进度条。当我检查web上的元素时,我确实看到了表示成功/进度的div。我确实看到文件大小和文件名在放入文件时出现。有人能指出我错过了什么吗?我的代码如下:
| serverURL url |
serverURL := RepWebSettings portalSettingsWebServerURL ifNil: [self session requestContext request uri serverURL].
url := serverURL ,
html context actionUrl printString ,
'&' , (html callbacks store: (Seaside.WAValueCallback on: [self uploadFileDroppedFiles])).
html div class: 'layoutBorder'; with: [
html div id: 'draganddropupload'; class: 'dropzone';
with: [
html div class: 'dz-message'; with: [
html image url: RepWebFileLibrary / #draganddropPng]]].
html script: ('
$(document).ready(function () {
Dropzone.autoDiscover = false;
Dropzone.uploadMultiple = true;
Dropzone.createImageThumbnails = false;
$("#draganddropupload").dropzone({
url: "%1",
success: function (file, response) {
document.location.reload(true);
}
});
});' bindWith: url). 发布于 2016-04-10 01:53:43
当你在打开“控制台”标签的Chrome开发者工具上运行你的例子时,你看到了什么javascript错误?看起来Dropzone管理进度条和复选标记。
看看他们的简单例子:
https://github.com/enyo/dropzone/blob/gh-pages/examples/simple.html
你得到的东西和他们得到的东西之间唯一的区别是,他们使用的是带有“dropzone”类的“form”标签,而你使用的是“div”标签。
因此,Dropzone可能希望以一种“形式”运行,而没有任何其他形式的输入。因此,如果换成我,我会将seaside代码中的div标记更改为表单,并确保新表单没有嵌套在页面上的另一个表单中。
https://stackoverflow.com/questions/36160960
复制相似问题