There is no problem with this at all, a perfectly normal and reasonable thing.
Sometimes itβs possible to use data to send data, rather than markup and expand it using templates on the client side, but mainly for situations when you send a lot of data and therefore want to save the size on the wire, (For example, a large table in which the view HTML is 100 thousand, but raw data, for example, in JSON format, is only 10 thousand). Or when patterns vary depending on client-side conditions. But overall, great for sending HTML, you then include in the DOM via innerHTML (or any wrappers from several libraries for it that help you with odd jitter).
source share