In some of my pages I have "templates". For example, I might have a table, and I have a "template" for each row in the table
<div class="wholeRow"><div class="lefCol"><!-- some stuff will go here --></div>...
Then I use JS to fill out this table. It's a bit silly though that the user has to load this template every single time they visit the page - I should be able to cache it.
I'm not sure how to go about caching it though; the only thing I can think of is put it in a static javascript file and wrap it all with document.write
, but that seems kind of, well, stupid. Does anyone have other ideas?