jquery append content after erasing previous content
-
12-11-2019 - |
Pregunta
I thought that using .append function previous finding specifyc content in a .json file it will returns only one time content if i put .empty property of a div before .append once again. BUT I'M WRONG.
I think there must be a function stopping these cycle but I dont get it.
$('#mn_1').live('click', function() {
$('#tt_mn').text("");
var idx = $(this).data('articleidx');
$.getJSON("auth/data_prod.json", function(data) {
$("<p class='prod_c'>" + data.articles[idx].title + "</p>").appendTo("#tt_mn");
});
});
at document.ready
$(document).ready( function() {
$('#tt_mn').text("");
});
thank you very much.
No hay solución correcta
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow