Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8430739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:40:09+00:00 2026-06-10T05:40:09+00:00

I was trying out the Treeview from jQuery on my Visualforce page and for

  • 0

I was trying out the Treeview from jQuery on my Visualforce page and for some reason it is not working.

Here is the relevant code.

          <apex:outputPanel id="invisibleSection" layout="block" styleClass="invisibleSectionClass">
          <script type="text/javascript">
          $("#browser").treeview();
           document.write('hi');
                $(document).ready(function() {
                        $("#navigation").treeview({
                        persist: "location",
                        collapsed: false,
                        animated: "medium"
                         });
                });

          </script>
          <ul id="browser" class="filetree">
            <li><span class="folder">Folder 1</span>
                <ul>
                    <li><span class="file">Item 1.1</span></li>
                </ul>
            </li>
            <li><span class="folder">Folder 2</span>
                <ul>
                    <li><span class="folder">Subfolder 2.1</span>
                        <ul id="folder21">
                            <li><span class="file">File 2.1.1</span></li>
                            <li><span class="file">File 2.1.2</span></li>
                        </ul>
                    </li>
                    <li><span class="file">File 2.2</span></li>
                </ul>
            </li>
            <li class="closed"><span class="folder">Folder 3 (closed at start)</span>
                <ul>
                    <li><span class="file">File 3.1</span></li>
                </ul>
            </li>
            <li><span class="file">File 4</span></li>
        </ul>

I put the document.write('hi'); to check if the javascript section was even being called and it is being printed. Therefore something else is wrong I think. I have included Treeview(zip file) as a static resource.

So what am I doing wrong for this not to work.

<apex:includeScript value="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.cookie.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.treeview.js')}"/>

<apex:stylesheet value="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.treeview.css')}" />

UPDATE based on John’s suggestion below:

  $(document).load(function () {

             $("#browser").treeview();

             $("#navigation").treeview({
                        persist: "location",
                        collapsed: false,
                        animated: "medium"
                         });

            });  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:40:11+00:00Added an answer on June 10, 2026 at 5:40 am

    At first glance it appears that you might need to move your script tag below the UL tag. Because it is an inline script tag the DOM might not be aware of the UL id “browser” at the point that script runs. I would even go so far as to move the $("#browser").treeview(); inside of the document.load method. This will ensure that the code is called after the page is done rendering and the DOM is established.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying out jstree, the jquery plugin to create a treeview. It works fine,
I trying out some problems in Google's Code Jam. For the question Store Credit
Was trying out some code with the EF code first method and ran into
Trying out the examples found on pleac.sf.net , I'm not able to get an
I am trying out some examples with analytical functions and i have created a
I'm trying to implement drag/drop in my TreeView and have it all working except
I am trying to create a TreeView from the Silverlight TreeView control. I have
I am trying to figure out how to highlight a node on a treeview
Trying out databinding for the first time, but something isn't working. I'm trying to
Trying out Linq for NHibernate and first noticed this: var list1 = (from ut

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.