Alex T
Alex T

Reputation: 3754

Appending big html file to modal window

I'm trying to append large amount of HTML(around 10k lines) to bootstrap modal.

async function generatereport(){
    $('#ProfilingReport').empty();
    let BIGHTML = await GenerateBIGHTML();
    $("#ProfilingReport").append(BIGHTML);
}

And html

<div class="modal-body" id="#ProfilingReport">
        </div>

However the modal is still empty after the function has finished running. Is there a way to append big amount of html to a modal or a window?

Upvotes: 0

Views: 136

Answers (1)

Ian
Ian

Reputation: 329

# selector is used when call the data from div or to pass data into div in jQuery

You need to remove the # symbol from div's id="#ProfilingReport"

<div class="modal-body" id="ProfilingReport">
</div>

Reference: https://api.jquery.com/id-selector/

Upvotes: 3

Related Questions