Cloudinary $.cloudinary.unsigned_upload_tag 不是函数

Cloudinary $.cloudinary.unsigned_upload_tag is not a function

我正在尝试进行云端未签名上传。我在 html 中有文件标签,现在我正尝试通过 JavaScript 初始化它。但是,我收到了很好的错误,状态 $.cloudinary.unsigned_upload_tag is not a function。这是相关代码:

图书馆内含物

<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' }));

错误在追加行。更奇怪的是,每当我 select 一个文件时,上传 触发的,但它上传了鲜花的样本图片。

输入字段应包含 name="file" 属性:

<input type="file" name="file" id="selectedFile" />

而JS初始化应该是:

$("#selectedFile").unsigned_cloudinary_upload("af8fvvkw",{ cloud_name: 'wearnator' });

让我知道它是否适合你?