Does changing the innerText of a DOM element result in a new layout calculation/render?

I know that certain changes to the DOM of a web-page (by JavaScript) will result in the rendering engine calculating a new layout for rendering (not sure if my terminology is correct). I have a process that updates data fairly frequently with comet style long-polling requests. Some of these updates are fairly frequent. I know that a good general rule of thumb is to remove the target DOM element, make the necessary changes, and then put it back into the DOM (so you only get hit twice with the re-render), but I wasn't sure if you only replace the inner text of an element if you incur the same hit. In my case, I am updating the content of some table-cells, that are just text (not wrapped in spans or divs).

以上就是Does changing the innerText of a DOM element result in a new layout calculation/render?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏