动态绑定事件到特定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元素添加一个事件 包括新增的节点
posted @ 2017-04-29 16:06  园芳宝贝  阅读(239)  评论(0编辑  收藏  举报