Best practices for Storing JSON in DOM

后端 未结 4 1037
刺人心
刺人心 2021-01-05 05:34

I want to render some json data using HTML template.

I haven\'t started implementing anything yet, but I would like to be able to \"set\" values of data from json t

4条回答
  •  执念已碎
    2021-01-05 05:51

    Why not store it as nature intended: as a javascript object? The DOM is a horrible place.

    That said, jQuery has the data method that allows just this.

提交回复
热议问题