This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Odd subject, but can't think of a better description. I have a series of forms that are submitted to the server via jQuery's Form plugin. That plugin requires a dataType be specified so it knows how to pre-process the response. In a lot of cases I simply return JSON that has a specific structure containing errors messages (if any) and usually a JSON'ified object that I can use in my client side code.
I have a somewhat special case in that I still need the JSON data, but I part of the post-processing requires me to build quite a bit of HTML. I'd rather just send the HTML with the response and load it into a container. I know that I can put the HTML in JSON
What I'm wondering is if I'm missing something simpler or better?
Probably not, although I'll be interested in hearing what you come up with--I had to do something similar and used FreeMarker to generate the embedded HTML and just left it at that. Never had to do it since then, either.