I know its bad to store data in the DOM, but why?

后端 未结 4 1724
一向
一向 2020-12-07 18:47

I\'ve heard over and over again that it is bad practice to \"use the DOM as a database.\"

While I mostly agree with that sentiment, this question is more about the l

4条回答
  •  广开言路
    2020-12-07 19:33

    I don't think there is anything wrong with storing data in the DOM, but I think the issue lies with storing a lot of data in the DOM. The browser does have to muddle through the DOM to output the pages we see, and the more data that is in there the more crap it has to sort out.

    I'm sure there are also other reasons as well, this is just my deduction.

提交回复
热议问题