Frage

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.

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top