I'm writing a web application / UI for a game that's done purely in HTML. A lot of things are in common like the top bar, menu bar, pop-up friends UI and the like. Normally, something like this is done with server-side includes? I've heard document.write is inherently evil - so what's the options client sided?
问问题
56 次
1 回答
0
There are a few ways you could do this:
Client-side Templating - check out Moustache and Handlebars
AJAX - You could load the header/footer asynchronously and render them around your content (or vice-versa, create your site as a single-page application, loading the wrapper first, then loading the page content asynchronously and inserting that into the wrapper).
iFrames / Framesets - Old-school, but it will do what you want, more or less.
于 2013-06-14T01:51:03.860 回答