Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Allows dynamic loading of HTML views (fragments)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 demo
Octocat-spinner-32 README.md
Octocat-spinner-32 bower.json
Octocat-spinner-32 jquery.viewloader.js
Octocat-spinner-32 jquery.viewloader.min.js
README.md

jQuery ViewLoader

ViewLoader allows you to break up a page into multiple views using your template engine of choice (e.g. jQuery Template or jsView), each loaded and rendered dynamically. When combined with KnockoutJS you can have each view be data-bound to a view model.

Syntax

$(document).viewloader({
    logLevel: "debug",

   afterEachTemplate: function (templateId) { 
      // code to execute after each view has been successfully loaded
   },

   success: function (successfulResolution) {
      // Code to execute once all views have been loaded for the page
   },

   error: function (failedResolution) {
      // Code to execute if an error occurs while loading the views 

});

Demo

See the demo folder for a complete example. The demo consists of:

  1. An index.html containing 2 views, each view has a subview
  2. Four separate view files (with the .view.html extension)
  3. An application.js with an InitializeApplication function initializing the ViewLoader

(c) 2011 Philippe Monnet (@techarch) http://blog.monnet-usa.com/

Something went wrong with that request. Please try again.