HTML and CSS Reference
The Browser as a Platform
HTML, are the saviors of enterprise development. To others, those UI frameworks create
a massive bottleneck and tie you to stale ideas and structures.
Today, developers are forced to look at web application architecture from a different
Client Versus Server HTML Generation
Somewhere between 2008 and 2009, the server-heavy culture of generating HTML and
other resources on the backend broke down. This was mostly due to the progressive
enhancement of web pages with AJAX and other performance optimizations. This way
of thinking forced developers to create better APIs and more efficient ways of delivering
data to web applications through JSON and XML.
Generating HTML on the client reduces server load and can deliver a better overall user
experience. JSON and XML use less bandwidth than presentation-ready HTML, and
there is less string concatenation and HTML escaping to perform. The client browser
to control how resources are delivered and how the application is enhanced. This also
gives you the flexibility of using CDN bandwidth for such popular libraries as jQuery.
When using a CDN for resource delivery, you are betting that the user has already
downloaded this library through another website using the same CDN. This spares users
the bulk and expense of downloading a 33K (gzipped) library like jQuery yet again.
When everything runs on the client, however, performance is reduced. Parsing JSON
or XML and generating HTML uses more memory and processing time than just print‐
ing some server-rendered HTML.
Whether you are generating HTML on the client or the server, there are pros and cons
to each approach.
The client-side approach offers these benefits:
• Better user experience
• Network bandwidth reduction (decreases cost)
• Portability (offline capable)
The most notable client-side con is security. When you create an offline-capable appli‐
cation that is distributed across many different browsers, WebStorage ( localStorage )
is the only viable means for storing data on the client—and it offers no security.