Building an HTML table on the fly using jQuery

前端 未结 8 785
夕颜
夕颜 2020-12-07 18:18

Below is the code I use to build an HTML table on the fly (using JSON data received from the server).

I display an animated pleasewait (.gif) graphic while the data

8条回答
  •  抹茶落季
    2020-12-07 18:35

    What you are doing is building a string, and then parsing it all at once upon insertion. What about creating an actual table element (i.e. $("

    ")), and then adding each row to it in turn? By the time you actually insert it into the page, the DOM nodes will all have been constructed, so it shouldn't be as big a hit.

    提交回复
    热议问题