我正在使用 Highchart 库。我通过格式化程序函数回调创建了一个工具提示,并在工具提示中插入一个链接。
config.tooltip.formatter = function(){
//console.log(this)
var tooltipHTML = "<b>? " + this.y + "% - " + this.key + "</b>";
var userImg = $('.user-picture').html();
if (userImg) {
tooltipHTML += "<div class='user-avatar-comment'>";
tooltipHTML += userImg;
tooltipHTML += "</div>";
}
tooltipHTML += "<div class='comment_filter'><a class='comments_buble' href='#' data-series='" + this.point.index + "'>Comment</a></div>";
return tooltipHTML;
}
Run Code Online (Sandbox Code Playgroud)
现在我想在点击时调用 ajax 但点击事件没有触发。
jQuery('.comments_buble').on('click', function(e) {
//ajax call here
})
Run Code Online (Sandbox Code Playgroud)
这是代码