I am working on a project that allows users to view log files of their projects that are stored on the server.
To reduce the amount of requests made to a server, once a log file is requested I store it in an array, and then load directly from there if it is requested again.
The way I am loading it is by using $(‘#log’).html(text), and this causes a bit of a delay when I load the text into the div (It is about 65k of text).
Is there a better way to do this, or is this always going to cause some sort of delay?
If the log text is just text and not HTML markup, use
.text()instead of.html():That should speed things up.