0

I was trying to use const array for append function, but i seems it can't be seen there.

I tried to add arguments to function nextAppend, but it has no use.

function displayCombat()
{
    $.ajax({
        url: "../php/players_fight.php",
        cache: false,

        success: function (json) {

            const battleLog = JSON.parse(json);

            for (i = 1; i < battleLog.length; i++)
            {
                $('#cWin').append('').delay(200).queue(function nextAppend()
                {
                    $(this).append(battleLog[i]);
                    nextAppend();
                });
            }
        }
    });

    return false;
}

In result nothing is appearing on log div. "Duplicated" solution does not work...

Ark Luis
  • 275
  • 3
  • 14

0 Answers0