Hello, my problem is the following, I have a script that allows me retrieve data in json format and with those data I have to build a view with Images and I need to apply a plugin but the new Elements added do not work.
Here is my code:
<script type="text/javascript">
$('#busquedaanuncio').keyup(function(e) {
var busqueda = $(this).attr('value');
$.ajax({
type: 'GET',
data: 'busqueda=' + busqueda,
url: "<? echo PUBLIC_PATH . 'announcementm/search' ?>",
success: function(data) {
$('#dvrelacionados').html('Terminos relacionados');
}
});
$('#dvpublicaciones').html('');
$.ajax({
type: "GET",
data: '{}',
url: "http://192.168.0.110:3000/announcet/" + busqueda,
dataType: "jsonp",
processdata: true,
success: function(data) {
$.each(data, function(index, objeto) {
$("#dvpublicaciones").append(
'<div class="publicacion">' +
'<img class="panel" src=' + "<? echo PUBLIC_PATH ?>" + objeto.rutaimganuncio + '>' +
'<div class="cap-overlay hide"><h5>Darth Vader</h5><p>Luke, yo soy tu padre, sÃgueme al lado oscuro de la fuerza...</p></div>'+
'<table><tr>' +
'<td width="12%"><img class="imgusr" src=' + "<? echo PUBLIC_PATH ?>" + objeto.rutaimg + '></td>' +
'<td width="88%"><b>' + objeto.titulo + '</b><br/>' +
objeto.texto.replace('&', '') + '</td></tr></table>' +
'</div>'
);
});
data = null;
}
});
});
$('.panel').hcaptions({effect: "fade"});//This Plugin does not work