Simple html vs Javascript generated html?

前端 未结 12 1576
故里飘歌
故里飘歌 2020-12-30 13:09

In my web application I would like to complately avoid html and use only javascript to create web-page\'s dom tree.

What is faster writing web content in the traditi

12条回答
  •  独厮守ぢ
    2020-12-30 13:44

    As you I was wondering the same and made a similar test as @evilReiko did:

    In order to render a page containing a table with 1000000000 of records I found the following results:

    • static html file : file size 32MB, page loading time 2.8 Min
    • static html file with minified content: file size 12MB, page loading time 1.3 Min
    • dynamic html file generated by JS: file size 612 byte (+ 713 byte of JS), page loading time 10.09 seconds...

提交回复
热议问题