开发者

Any way to reduce repetitive markup in webpages or something like caching such frequently used markup?

When you have the same set of buttons on each item row of a long list of items. Is ther开发者_StackOverflow中文版e any way to reduce the markup (of repeated elements on the page)? Any way to make it more efficient ?

Is there any facility to cache that kind of markup like CSS or js files. I am looking out for this solution for a web 2.0 site.

Edit

Not looking for a server side solution, as I am already aware of those. I am bascially concerned about reducing file size of my webpages transferred to user's browser.


There are a few ways:

  1. Generate the HTML using a server-side language (PHP, ASP, etc) and use loops to create the repetitive markup

  2. Create the markup in Javascript, inserting elements into the DOM via a loop.

  3. Use a template to provide the markup, and include the template as many times as needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜