用ajax返回json数据,生成a标签,每个标签绑定点击事件,生成弹窗
for(var i=1;i
html += '
';html += '
'+ data[i].name +'';html += '
'+ '//javascript:return false;
html += '
'+ ' ' +data[i].title+''+'';html += '
'+ getLocalTime(data[i].ctime) +'';html += '
';}
点击每个a标签就会出现弹窗,弹窗里绑定的是console.log($(this))也没有任何数据产生
$('td a').each(function(i){
$(this).on('click',function(){
window.open(this.href,"","width=500,height=500,top=200,left=500");
})
});
这是什么原因,怎么解决呢