Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
This is the forum to discuss the Wrox book Professional JavaScript for Web Developers by Nicholas C. Zakas; ISBN: 9780764579080
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 6th, 2005, 02:15 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to peryan77
Default Array Help - Thus far no one was able to help.

I need some help with taking the array "pcor_sections" and exactly creating the "TREE_NODES" array. I am new to JS and you seriously don't want me to paste what I have so far. It's confusing.
Some rules are posted at the bottom to make it easier to understand.


var pcor_sections = [ 0

,'<p class="chap"><a href="chf-ES.htm#P6_36" target="_top">Executive Summary</a></p>'

,'<p class="ahead"><a href="chf-ES-cmc-00.htm#P52_1438" target="_top">What are the key parameters of the CHF market?</a></p>'

,'<p class="chap"><a href="Pharmacor-Chapter-Head.htm#P89_11313" target="_top">Introduction</a></p>'

,'<p class="chap"><a href="CHF-EP-cmc.htm#P210_16143" target="_top">Etiology and Pathophysiology </a></p>'

,'<p class="ahead"><a href="CHF-EP-cmc-02.htm#P242_29404" target="_top">Etiology</a></p>'

,'<p class="bhead"><a href="CHF-EP-cmc-02.htm#P13_3767" target="_top">Causes of Chronic Heart Failure</a></p>'

,'<p class="bhead"><a href="CHF-EP-cmc-02.htm#P18_5924" target="_top">Clinical Characterization of Chronic Heart Failure</a></p>'

,'<p class="ahead"><a href="epi-mock-up-cmc-03.htm#P62_16890" target="_top">United States</a></p>'

,'<p class="chap"><a href="chf-ct.htm" target="_top">Current Therapies</a></p>'

,'<p class="ahead"><a href="chf-ct-cmc-00.htm" target="_top">Diuretics</a></p>'

];


var TREE_NODES = [

    f(["Executive Summary", "chf-ES.htm", null,
        f(["What are the key parameters of the CHF market?", "chf-ES-cmc-00.htm", null]),
    ]),


    f(["Introduction", "Pharmacor-Chapter-Head.htm", null,{format:{isFolder:true}}]),


    f(["Etiology & Pathophysiology", "CHF-EP-cmc.htm", null,
        f(["Etiology", "CHF-EP-cmc-02.htm", null,
            f(["Causes of Chronic Heart Failure", "CHF-EP-cmc-02.htm#P13_3767", null]),
            f(["Clinical Characterization of Chronic Heart Failure", "CHF-EP-cmc-02.htm#P18_5924", null])
        ]),
        f(["United States", "epi-mock-up-cmc-03.htm#P62_16890", null]),
    ]),


    f(["Current Therapies", "chf-ct.htm", null,
        f(["Diuretics", "chf-ct-cmc-00.htm", null]),
    ]),

        ];


Rules
remove #p242_2393 framgments where the classes = chap or ahead.
if a chap has no ahead or bhead following it then we need to add {format:{isFolder:true}} (see introduction)
Also, notice the brakets ] and when they should or shouldn't close. Like if Ahead has B head you keep the Ahead open and close after bhead.


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
error when sorting an Array of Array nancy VBScript 2 February 17th, 2005 12:57 PM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM
Array to Array comparison pavel Pro VB 6 0 March 24th, 2004 06:33 PM



All times are GMT -4. The time now is 04:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.