Christian Schmitt
Christian Schmitt

Reputation: 892

Creating Dom Structure or Only Manipulating (Best Practice) (Hows does Google do it)

What is the best Practice in creating a RIA via JavaScript and the Google Closure Library? To Have one HTML Site that gets loaded and the Javascript will creating all Dom elements or is it better to have multiple html sites where only some elements gets manipulated?

I mean our Application don't needed to be indexed and will only be hosted in internal networks, but I really don't know yet, whats better. I think Google Mail is something that creates every Dom element on start and then won't switch the site, just loads json objects from the backend. I think this seems to be a good way to do it, but is this really the best way to do it?

How would you build your applications?

Upvotes: 0

Views: 139

Answers (1)

lennel
lennel

Reputation: 646

our applications need to be indexed to an extent. we use soy templates, render the initial html on the server, then use the decoration phase to enable the javascript controls. after the application has init'd (ala decorated) we just pull json and draw on the client.

In this way we get content to screen extremely fast and for the rest have a single page app. we also use html 5 history, thus when navigating to a different part of the app, the url changes, thus you can bookmark any page and we obviously have the ability to pre-render any page.

Upvotes: 1

Related Questions