Generating HTML code dynamically with jQuery
I suggest you put the template html in an invisible div in the page html. 
Then reference and clone it from javascript.
Then replace "tags" with data from the json request and insert the new html in the page at the appropriate place.

You can then redesign the page without touching the javascript code.