Simple html vs Javascript generated html?

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

    The traditional approach is going to be faster because the browser only has to download, interpret and display. The approach you're suggesting would cause the browser to have to download, interpret, change * n times and then display.

    That's as far as rendering goes.

    As far as maintainability goes, you're creating a nightmare. That's the key to development. The number of nightmares in maintainability is proportional to the "quality" of the code, IMHO. Performance and optimization should come second to maintainability. (There are exceptions, of course. Nothing is black-and-white).

    HTML was created to be an expressive language. Javascript wasn't. End of story, in my opinion.

提交回复
热议问题