Removing Chrome's “translate” DOM Property

前端 未结 2 1226
轻奢々
轻奢々 2021-01-23 20:53

I\'m working with some legacy code where the original developers made heavy use of generating HTML DOM nodes with a non-standard attribute named translate

2条回答
  •  北海茫月
    2021-01-23 21:42

    Replace the nonstandard attribute translate by an attribute like data-translate, which is virtually guaranteed to be and to remain undefined in HTML specifications and in browsers. The data-* attributes were invented to prevent issues like this, and they can also be used to fix them.

提交回复
热议问题