$(document).on("click", ".preview", function(){
var id = $(this).attr('id');
$.ajax({
type: 'post',
data: 'id=' + id,
url: '/ajax/preview.php',
success: function (data){
$.fancybox(data); //data = '<div id="#preview_item">HTML CODE</div>'
return false;
},
error: function(){
alert('fatal error');
}
});
return false;
});
$(document).on("click", ".preview", function(event){
event.preventDefault()
....
});