动态绑定事件到特定dom元素上,包含新增加的

$('body').on('click', 'a.detail-data', function (e) {    //动态事件绑定  为body元素下所有的a.detail-data元素添加一个事件 包括新增的节点
                var href = $(this).attr("data-url");
                var url = window.location.protocol + "//" + window.location.host + href;
                bridge.callHandler('EbwaysExhibitionList', {'url': url}, function (response) {
                    console.log('log' + response);
                })
            });
$('body').on('click', 'a.detail-data', function (e) {    //动态事件绑定  为body元素下所有的a.detail-data元素添加一个事件 包括新增的节点
原文地址:https://www.cnblogs.com/gmq-sh/p/6785445.html