首页 > 编程学习 > js 添加图片

js 添加图片

发布时间:2022/11/24 23:24:56

view - html

 <div class="col-sm-12"><div class="form-group"><label for="tcicon">图标<a id="reseticon">重置</a></label><input id="tcicon" type="file" name="icon" class="form-control"><input id="tciconsrc" type="hidden" name="icon" class="form-control"></div></div>

-js

postflag = true;initFileInput("tcicon", "<{spUrl c=proxytc a=uploadicon}>", "");$("#tcicon").on("fileuploaded", function(event, data, previewId, index) {var code = data.response.code;if (code == "0") {$("#tciconsrc").val(data.response.url);} else {layer.msg(data.response.message, {icon: 5, closeBtn: 1, shadeClose: true});$('#tcicon').fileinput('reset');}});$('#tcicon').on('filecleared', function(event) {$("#tciconsrc").val("");});







本文链接:https://www.ngui.cc/el/2111917.html
Copyright © 2010-2022 ngui.cc 版权所有 |关于我们| 联系方式| 豫B2-20100000