js 添加图片

来源:互联网 发布:软件工资 编辑:程序博客网 时间:2024/06/07 12:02

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("");    });






0 0
原创粉丝点击