简单的html vs Javascript生成的html? [英] Simple html vs Javascript generated html?
问题描述
在我的Web应用程序中,我希望避免使用html,只使用javascript来创建网页的dom树。方式在html < div>一些文本< / div>
或使用javascript dom渲染,像这样: div.appendChild(document.createTextNode(一些文本));
?
坚持使用传统的HTML。它不仅比使用javascript做的更快,更加可维护。
除非有令人信服的原因,否则请坚持使用直接的HTML,并使用JavaScript来实现更多互动的应用程序。
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 traditional way in html <div>Some text</div>
or using javascript dom render, like this: div.appendChild(document.createTextNode("Some text"));
?
Stick with the traditional HTML. It's not only faster than doing everything with javascript, it's much more maintainable.
Unless there is a compelling reason otherwise, stick with the straight up HTML and use javascript for the more interactive pieces of your app.
这篇关于简单的html vs Javascript生成的html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!