Putting HTML in JSON

后端 未结 3 704
不知归路
不知归路 2020-12-18 21:30

As per title, is it considered a good practice to put HTML in JSON? The reason I need to do this is because I would like to have a custom dropdown where the list is coming f

3条回答
  •  青春惊慌失措
    2020-12-18 22:16

    You could, sure, but you could just as easily pass the values as an array in the JSON and put the HTML rendering code in the client; saving you server cycles, bandwidth bytes, and logic-presentation blending.

提交回复
热议问题