Javascript – when to load partial views

ajaxhtmljavascript

When creating a website, when should you load partial view and when should you do a complete page refresh?

I was looking at github's site and noticed that pretty much the only place they do partial loading is in a project's folder area. I could see a couple places where they could have but didn't(tab navigation: feed, your actions, …). But, Google plus does partial loads for search, and clicking on any of the header navigation buttons (pictures, games, circles, …).

Why would you not do partial loading if the main container stays the same and the content is the only thing that is changing?

Best Answer

My first advice is when the action suggests it, use navigation. This doesn't tell a lot but think of nav buttons or links to articles from the same page, etc where users intuitively awaits full navigation responses.

Partial page request are for places where a new rendered page is too much, like photos slides, little pieces of information, or adding a post like here. You wouldn't expect a PPR when clicking on a stackexchange question but you do when voting up a question.

In addition, PPR and browser history is sometimes difficult to implement. Don't work in vain when users won't expect, need or appreciate partial loading.

Related Topic