Simple html vs Javascript generated html?

前端 未结 12 1577
故里飘歌
故里飘歌 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:41

    HTML is parsed and generated by the browser and then entered into the DOM. Using javascript to manipulate the dom piece by piece is more overhead.

    Imagine if you had to retype an article from a magazine. Now imagine doing so if every sentence was on a new page. ALthough the end result is a copied article, you had to spend all that time flipping pages.

提交回复
热议问题