{% load static %}
<script src="{% static 'js/jquery.js' %} "></script>
<script>
    function trolled(lol, jhol, thiss) {
        $.ajax({
            url: 'unfavorite',
            type: 'POST',
            data: {'label': lol, 'name': jhol},
            dataType: 'json',
            success: function (data) {
                if (data == 0) {
                    $('#favorite_app').hide()
                } else {
                    $(thiss).parentsUntil(".favoriteSelectorss").remove()
                }
            }
        });

    }

    $(document).ready(function () {
        $.ajax({
            url: "favorite",
            context: document.body,
            success: function (data) {
                if (data.count != 0) {
                    $('#favorite_app').append(data.dist_data);
                } else {
                    $('#favorite_app').hide();
                }
            }
        });
    });


</script>
<div id="favorite_app" class="app-admin_favorite module">
</div>

