What's wrong with adding properties to DOM Element objects?

前端 未结 3 1359
情书的邮戳
情书的邮戳 2020-12-01 07:51

I\'ve been looking for a straight answer for this (I can think of lots of possiblities, but I\'d like to know the true reason):

jQuery provides a .data() method for

3条回答
  •  不思量自难忘°
    2020-12-01 08:50

    It has to do with the fact that DOM in IE is not managed by JScript, which makes it completely different environment to access. This leads to the memory leaks http://www.crockford.com/javascript/memory/leak.html. Another reason is that, when people use innerHTML to copy nodes, all those added properties are not transfered.

提交回复
热议问题