作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试进行 cloudinary 未签名上传。我有 html 中的文件标签,现在我尝试通过 JavaScript 初始化它。但是,我收到了奇妙的错误,即状态 $.cloudinary.unsigned_upload_tag 不是函数
。相关代码如下:
库包含内容
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/cloudinary/cloudinary_js/master/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/cloudinary/cloudinary_js/master/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/cloudinary/cloudinary_js/master/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/cloudinary/pkg-cloudinary-jquery/master/cloudinary-jquery.min.js"></script>
上传标签
<input type="file" id="selectedFile" style="" />
初始化JS
$.cloudinary.config( { cloud_name: "wearnator"});
$("#selectedFile").append($.cloudinary.unsigned_upload_tag("af8fvvkw",{ cloud_name: 'wearnator' }));
错误出现在附加行上。更奇怪的是,每当我选择一个文件时,就会触发上传,但它会上传花朵的样本图片。
最佳答案
输入字段应包含 name="file"
属性:
<input type="file" name="file" id="selectedFile" />
JS初始化应该是:
$("#selectedFile").unsigned_cloudinary_upload("af8fvvkw",{ cloud_name: 'wearnator' });
请告诉我它是否适合您?
关于javascript - Cloudinary $.cloudinary.unsigned_upload_tag 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36602683/
我正在尝试进行 cloudinary 未签名上传。我有 html 中的文件标签,现在我尝试通过 JavaScript 初始化它。但是,我收到了奇妙的错误,即状态 $.cloudinary.unsign
我是一名优秀的程序员,十分优秀!