JavaScript Breadcrumbs navigation

יום שבת, ינואר 23, 2010

In this code listing I want to demonstrate how to implement "Breadcrumbs" in JavaScript for the pages collection, where page object have a two main key's pageId and parentPageId, and create a new collection sorted by current parents.   Listing 1:  function page(pageId, parentPageId, title) { return this.constructor(pageId, parentPageId, title); }page.prototype = { // properties pageId: null, parentPageId: null, title: "", setPageId: function(pageId) { this.pageId = pageId; ...