gpt4 book ai didi

javascript - Cloudinary $.cloudinary.unsigned_upload_tag 不是函数

转载 作者:行者123 更新时间:2023-12-03 07:11:27 26 4
gpt4 key购买 nike

我正在尝试进行 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/

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