jQuery 动态生成的 input 绑定事件监听

// 替换图片
// $(document).on("input propertychange", "#mytbody .my_rate", function (e) {
$(document).on('input propertychange', '.exchange-input',function() {
console.log("替换图片调用");
                layer.load(2);
                var fileId = '#' + $(this)[0].id;
                fileUpload(fileId, "#inspectionRecordLogForm", "hzz_handling", function(data) {
                    console.log(data);
                    var id = fileId.replace('#input','');
                HzHttp.httpPost('/inspeciton/inspectionRecord/updateImage', {
                    fileId: id,
                    filePath: data.url
                }, function(res) {
                    console.log(res)
                    $(fileId).parent().parent().find('img')[0].src = path + data.url;
                    $(fileId).parent().parent().find('.fancybox')[0].src = path + data.url

 

posted @ 2021-11-01 16:49  尘心i  阅读(455)  评论(0编辑  收藏  举报