Dropzone js无法正常工作 [英] Dropzone js not working without form

查看:75
本文介绍了Dropzone js无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用表单中的类的情况下使用dropzone。

How can I use dropzone without using the class in the form.

我基本上想要一个 div 在表单中并在该div中调用 class =dropzone。但它似乎不起作用。

I basically want to have a div inside a form and call class="dropzone" in that div. But it doesn't seems to work.

以下是我的代码:

<!DOCTYPE html>
<html lang="en">
    <head>
    <title></title>
    <link rel="stylesheet" href="css/basic.css" />
    <link rel="stylesheet" href="css/dropzone.css"/>
    <script src="dropzone.min.js"></script>
    <script type="text/javascript">
        var myDropzone = new Dropzone("div#myId", { url: "file-upload"})
    </script>

    <body>
        <form action="upload.php">
            <input type="text">
            <div id="myId" class="dropzone"></div>
        </form>
    </body>
</html>


推荐答案

你的url参数没有指向任何有效的php文件。我相信你的代码应该是

your url parameter is not pointing to any valid php file. I believe your code should be thus

<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<link rel="stylesheet" href="css/basic.css" />
<link rel="stylesheet" href="css/dropzone.css"/>
<script src="dropzone.min.js"></script>
<script type="text/javascript">
    var myDropzone = new Dropzone("div#myId", { url: "upload.php"}) //according to your forms action
</script>

<body>
    <form action="upload.php">
        <input type="text">
        <div id="myId" class="dropzone"></div>
    </form>
</body>

这篇关于Dropzone js无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆