simonexmachina / jquery-bonsai

Super lightweight jQuery tree plugin
http://simonwade.me/jquery-bonsai
MIT License
148 stars 42 forks source link

Can't save/restore bonsai state #12

Closed tigran123 closed 9 years ago

tigran123 commented 9 years ago

In my application there is a need to save and restore the collapse/expand state of the tree. So, what I have is this in the document.ready handler:

$(function(){
  if (sessionStorage.category_tree) {
     document.getElementById("tab_categories").innerHTML = sessionStorage.getItem("category_tree");
     bonsai_state_str = sessionStorage.getItem("bonsai_state");
     bonsai_state_obj = JSON.parse(bonsai_state_str);
     var tree_id = $('#category_tree');
     tree_id.bonsai();
     var bonsai = tree_id.data('bonsai');
     bonsai.restore(bonsai_state_obj);
     console.log(bonsai_state_obj);
  } else
     $.get("/categories.php",
        function(data) {
           document.getElementById("tab_categories").innerHTML = data;
           sessionStorage.setItem("category_tree", data);
           var tree = $('#category_tree');
           tree.bonsai();
        }
     );
});

and the following function serving as onclick handler for the Submit button:

function save_bonsai_state() {
   var tree = $('#category_tree');
   var bonsai = tree.data('bonsai');
   bonsai_state_obj = bonsai.serialize();
   bonsai_state_str = JSON.stringify(bonsai_state_obj);
   sessionStorage.setItem("bonsai_state", bonsai_state_str);
   console.log(bonsai_state_obj);
   return true;
}

The script categories.php is very straightforward:

<?php
ini_set('display_errors',0);
$lang = 'en';
if (isset($_COOKIE['lang']))
   $lang = $_COOKIE['lang'];
require 'msg_' . $lang . '.php';
require 'config.php';
require 'Categories.class';
require 'connect.php';
$cats = new Categories($db);
echo $cats->get_tree_as_html();
error_log("categories.php: sent tree as html");
?>

The ->get_tree_as_html() method outputs nested list (with unique ids for each node) in the exact format that bonsai expects, i.e. bonsai correctly renders the tree. However, the problem is that the save/restore state code above doesn't work, i.e. if I expand a few (or all) items in the tree and then click on Submit (thus causing the state to be saved in the local storage) I see in the console log that the state is restored successfully (i.e. no errors). However, looking at the tree itself I see that all nodes are collapsed --- i.e. all I see is the single root node and if I click on it all its children are collapsed too.

Examining the state object I see lots of items with the value "expanded" --- the very same ones that I expanded prior to saving the state. So, the state of the state is good, but something else may need to be done after (or before?) calling bonsai.restore(bonsai_state_obj).

simonexmachina commented 9 years ago

Probably the best info here would be a) the markup of the tree and b) the bonsai_state_str.

tigran123 commented 9 years ago

Here is the bonsai_state_str:

{"bonsai-generated-93885858-161":"expanded","bonsai-generated-92166205-152":"expanded","bonsai-generated-78011254-0":null,"bonsai-generated-78011254-1":null,"bonsai-generated-78011254-2":null,"bonsai-generated-78011254-3":null,"bonsai-generated-78011254-4":null,"bonsai-generated-78011254-5":null,"bonsai-generated-78011254-6":null,"bonsai-generated-78011254-7":null,"bonsai-generated-78011254-8":null,"bonsai-generated-78011254-9":null,"bonsai-generated-92166205-153":"collapsed","bonsai-generated-12644861-10":null,"bonsai-generated-12644861-11":null,"bonsai-generated-12644861-12":null,"bonsai-generated-12644861-13":null,"bonsai-generated-12644861-14":null,"bonsai-generated-12644861-15":null,"bonsai-generated-12644861-16":null,"bonsai-generated-12644861-17":null,"bonsai-generated-12644861-18":null,"bonsai-generated-12644861-19":null,"bonsai-generated-12644861-20":null,"bonsai-generated-12644861-21":null,"bonsai-generated-12644861-22":null,"bonsai-generated-12644861-23":null,"bonsai-generated-12644861-24":null,"bonsai-generated-12644861-25":null,"bonsai-generated-12644861-26":null,"bonsai-generated-92166205-154":null,"bonsai-generated-92166205-155":"collapsed","bonsai-generated-55196951-27":null,"bonsai-generated-55196951-28":null,"bonsai-generated-55196951-29":null,"bonsai-generated-55196951-30":null,"bonsai-generated-55196951-31":null,"bonsai-generated-55196951-32":null,"bonsai-generated-55196951-33":null,"bonsai-generated-55196951-34":null,"bonsai-generated-55196951-35":null,"bonsai-generated-55196951-36":null,"bonsai-generated-55196951-37":null,"bonsai-generated-55196951-38":null,"bonsai-generated-55196951-39":null,"bonsai-generated-55196951-40":null,"bonsai-generated-55196951-41":null,"bonsai-generated-55196951-42":null,"bonsai-generated-55196951-43":null,"bonsai-generated-55196951-44":null,"bonsai-generated-55196951-45":null,"bonsai-generated-55196951-46":null,"bonsai-generated-55196951-47":null,"bonsai-generated-55196951-48":null,"bonsai-generated-55196951-49":null,"bonsai-generated-55196951-50":null,"bonsai-generated-55196951-51":null,"bonsai-generated-55196951-52":null,"bonsai-generated-55196951-53":null,"bonsai-generated-55196951-54":null,"bonsai-generated-92166205-156":"collapsed","bonsai-generated-93047459-55":null,"bonsai-generated-93047459-56":null,"bonsai-generated-93047459-57":null,"bonsai-generated-93047459-58":null,"bonsai-generated-93047459-59":null,"bonsai-generated-93047459-60":null,"bonsai-generated-93047459-61":null,"bonsai-generated-93047459-62":null,"bonsai-generated-93047459-63":null,"bonsai-generated-92166205-157":null,"bonsai-generated-92166205-158":"collapsed","bonsai-generated-55359146-64":null,"bonsai-generated-55359146-65":null,"bonsai-generated-55359146-66":null,"bonsai-generated-92166205-159":"collapsed","bonsai-generated-98880030-70":"collapsed","bonsai-generated-49764104-67":null,"bonsai-generated-49764104-68":null,"bonsai-generated-49764104-69":null,"bonsai-generated-98880030-71":null,"bonsai-generated-98880030-72":null,"bonsai-generated-98880030-73":null,"bonsai-generated-98880030-74":null,"bonsai-generated-98880030-75":null,"bonsai-generated-98880030-76":null,"bonsai-generated-98880030-77":null,"bonsai-generated-92166205-160":"collapsed","bonsai-generated-55801077-141":null,"bonsai-generated-55801077-142":"collapsed","bonsai-generated-44822539-80":null,"bonsai-generated-44822539-81":null,"bonsai-generated-44822539-82":null,"bonsai-generated-44822539-83":"collapsed","bonsai-generated-32742332-78":null,"bonsai-generated-32742332-79":null,"bonsai-generated-44822539-84":null,"bonsai-generated-44822539-85":null,"bonsai-generated-44822539-86":null,"bonsai-generated-44822539-87":null,"bonsai-generated-44822539-88":null,"bonsai-generated-44822539-89":null,"bonsai-generated-44822539-90":null,"bonsai-generated-44822539-91":null,"bonsai-generated-44822539-92":null,"bonsai-generated-44822539-93":null,"bonsai-generated-44822539-94":null,"bonsai-generated-55801077-143":null,"bonsai-generated-55801077-144":null,"bonsai-generated-55801077-145":null,"bonsai-generated-55801077-146":"collapsed","bonsai-generated-12721204-95":null,"bonsai-generated-12721204-96":null,"bonsai-generated-12721204-97":null,"bonsai-generated-55801077-147":"collapsed","bonsai-generated-36693411-98":null,"bonsai-generated-36693411-99":null,"bonsai-generated-55801077-148":null,"bonsai-generated-55801077-149":null,"bonsai-generated-55801077-150":"collapsed","bonsai-generated-91265201-104":null,"bonsai-generated-91265201-105":null,"bonsai-generated-91265201-106":null,"bonsai-generated-91265201-107":null,"bonsai-generated-91265201-108":null,"bonsai-generated-91265201-109":null,"bonsai-generated-91265201-110":null,"bonsai-generated-91265201-111":null,"bonsai-generated-91265201-112":null,"bonsai-generated-91265201-113":null,"bonsai-generated-91265201-114":null,"bonsai-generated-91265201-115":null,"bonsai-generated-91265201-116":null,"bonsai-generated-91265201-117":null,"bonsai-generated-91265201-118":"collapsed","bonsai-generated-83574348-100":null,"bonsai-generated-83574348-101":null,"bonsai-generated-83574348-102":null,"bonsai-generated-83574348-103":null,"bonsai-generated-91265201-119":null,"bonsai-generated-91265201-120":null,"bonsai-generated-55801077-151":"collapsed","bonsai-generated-71569358-127":"collapsed","bonsai-generated-90817831-121":null,"bonsai-generated-90817831-122":null,"bonsai-generated-90817831-123":null,"bonsai-generated-90817831-124":null,"bonsai-generated-71569358-128":"collapsed","bonsai-generated-23760004-125":null,"bonsai-generated-71569358-129":null,"bonsai-generated-71569358-130":"collapsed","bonsai-generated-81942861-126":null,"bonsai-generated-71569358-131":null,"bonsai-generated-71569358-132":null,"bonsai-generated-71569358-133":null,"bonsai-generated-71569358-134":null,"bonsai-generated-71569358-135":null,"bonsai-generated-71569358-136":null,"bonsai-generated-71569358-137":null,"bonsai-generated-71569358-138":null,"bonsai-generated-71569358-139":null,"bonsai-generated-71569358-140":null}

and here is the value of category_tree (i.e. html code saved also in sessionStorage and fed to bonsai):

<br><ul id='category_tree'> <li><font id='li0' style='font-weight:bold;'>Books <a href='index.php?category_id=1'>(3500001 books, 161 subcategories)</a></font> <ul> <li><font id='li1' style='font-weight:bold;'>Fiction <a href='index.php?category_id=2'>(238821 books, 10 subcategories)</a></font> <ul> <li><font id='li2' style='font-weight:bold;'>Fables <a href='index.php?category_id=3'>(21877 books, 0 subcategories)</a></font></li> <li><font id='li3' style='font-weight:bold;'>Sci-Fi <a href='index.php?category_id=4'>(21708 books, 0 subcategories)</a></font></li> <li><font id='li4' style='font-weight:bold;'>Children <a href='index.php?category_id=5'>(21717 books, 0 subcategories)</a></font></li> <li><font id='li5' style='font-weight:bold;'>Historical <a href='index.php?category_id=6'>(21816 books, 0 subcategories)</a></font></li> <li><font id='li6' style='font-weight:bold;'>Adventure <a href='index.php?category_id=7'>(21847 books, 0 subcategories)</a></font></li> <li><font id='li7' style='font-weight:bold;'>Detective <a href='index.php?category_id=8'>(21663 books, 0 subcategories)</a></font></li> <li><font id='li8' style='font-weight:bold;'>Myths and Legends <a href='index.php?category_id=9'>(21934 books, 0 subcategories)</a></font></li> <li><font id='li9' style='font-weight:bold;'>Fantasy <a href='index.php?category_id=10'>(21571 books, 0 subcategories)</a></font></li> <li><font id='li10' style='font-weight:bold;'>Mystics <a href='index.php?category_id=11'>(21489 books, 0 subcategories)</a></font></li> <li><font id='li11' style='font-weight:bold;'>Poetry <a href='index.php?category_id=12'>(21528 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li12' style='font-weight:bold;'>Dictionaries <a href='index.php?category_id=13'>(389619 books, 17 subcategories)</a></font> <ul> <li><font id='li13' style='font-weight:bold;'>Arabic <a href='index.php?category_id=14'>(21411 books, 0 subcategories)</a></font></li> <li><font id='li14' style='font-weight:bold;'>Aramaic <a href='index.php?category_id=15'>(21510 books, 0 subcategories)</a></font></li> <li><font id='li15' style='font-weight:bold;'>Armenian <a href='index.php?category_id=16'>(21729 books, 0 subcategories)</a></font></li> <li><font id='li16' style='font-weight:bold;'>Coptic <a href='index.php?category_id=17'>(21822 books, 0 subcategories)</a></font></li> <li><font id='li17' style='font-weight:bold;'>English <a href='index.php?category_id=18'>(21662 books, 0 subcategories)</a></font></li> <li><font id='li18' style='font-weight:bold;'>French <a href='index.php?category_id=19'>(21546 books, 0 subcategories)</a></font></li> <li><font id='li19' style='font-weight:bold;'>Ethiopic <a href='index.php?category_id=20'>(21606 books, 0 subcategories)</a></font></li> <li><font id='li20' style='font-weight:bold;'>German <a href='index.php?category_id=21'>(21809 books, 0 subcategories)</a></font></li> <li><font id='li21' style='font-weight:bold;'>Greek <a href='index.php?category_id=22'>(21430 books, 0 subcategories)</a></font></li> <li><font id='li22' style='font-weight:bold;'>Hebrew <a href='index.php?category_id=23'>(21663 books, 0 subcategories)</a></font></li> <li><font id='li23' style='font-weight:bold;'>Italian <a href='index.php?category_id=24'>(21867 books, 0 subcategories)</a></font></li> <li><font id='li24' style='font-weight:bold;'>Latin <a href='index.php?category_id=25'>(21622 books, 0 subcategories)</a></font></li> <li><font id='li25' style='font-weight:bold;'>Portuguese <a href='index.php?category_id=26'>(21724 books, 0 subcategories)</a></font></li> <li><font id='li26' style='font-weight:bold;'>Russian <a href='index.php?category_id=27'>(21531 books, 0 subcategories)</a></font></li> <li><font id='li27' style='font-weight:bold;'>Slavonic <a href='index.php?category_id=28'>(21666 books, 0 subcategories)</a></font></li> <li><font id='li28' style='font-weight:bold;'>Spanish <a href='index.php?category_id=29'>(21697 books, 0 subcategories)</a></font></li> <li><font id='li29' style='font-weight:bold;'>Syriac <a href='index.php?category_id=30'>(21817 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li30' style='font-weight:bold;'>Encyclopedias <a href='index.php?category_id=31'>(21668 books, 0 subcategories)</a></font></li> <li><font id='li31' style='font-weight:bold;'>Grammars <a href='index.php?category_id=32'>(627536 books, 28 subcategories)</a></font> <ul> <li><font id='li32' style='font-weight:bold;'>Arabic <a href='index.php?category_id=33'>(21700 books, 0 subcategories)</a></font></li> <li><font id='li33' style='font-weight:bold;'>Aramaic <a href='index.php?category_id=34'>(21739 books, 0 subcategories)</a></font></li> <li><font id='li34' style='font-weight:bold;'>Armenian <a href='index.php?category_id=35'>(21645 books, 0 subcategories)</a></font></li> <li><font id='li35' style='font-weight:bold;'>Chinese <a href='index.php?category_id=36'>(21908 books, 0 subcategories)</a></font></li> <li><font id='li36' style='font-weight:bold;'>Coptic <a href='index.php?category_id=37'>(21852 books, 0 subcategories)</a></font></li> <li><font id='li37' style='font-weight:bold;'>Czech <a href='index.php?category_id=38'>(21713 books, 0 subcategories)</a></font></li> <li><font id='li38' style='font-weight:bold;'>Danish <a href='index.php?category_id=39'>(21978 books, 0 subcategories)</a></font></li> <li><font id='li39' style='font-weight:bold;'>Dutch <a href='index.php?category_id=40'>(21494 books, 0 subcategories)</a></font></li> <li><font id='li40' style='font-weight:bold;'>English <a href='index.php?category_id=41'>(21733 books, 0 subcategories)</a></font></li> <li><font id='li41' style='font-weight:bold;'>Esperanto <a href='index.php?category_id=42'>(21821 books, 0 subcategories)</a></font></li> <li><font id='li42' style='font-weight:bold;'>Ethiopic <a href='index.php?category_id=43'>(21685 books, 0 subcategories)</a></font></li> <li><font id='li43' style='font-weight:bold;'>Finnish <a href='index.php?category_id=44'>(21619 books, 0 subcategories)</a></font></li> <li><font id='li44' style='font-weight:bold;'>French <a href='index.php?category_id=45'>(21636 books, 0 subcategories)</a></font></li> <li><font id='li45' style='font-weight:bold;'>German <a href='index.php?category_id=46'>(21611 books, 0 subcategories)</a></font></li> <li><font id='li46' style='font-weight:bold;'>Greek <a href='index.php?category_id=47'>(21656 books, 0 subcategories)</a></font></li> <li><font id='li47' style='font-weight:bold;'>Hebrew <a href='index.php?category_id=48'>(21609 books, 0 subcategories)</a></font></li> <li><font id='li48' style='font-weight:bold;'>Hungarian <a href='index.php?category_id=49'>(21530 books, 0 subcategories)</a></font></li> <li><font id='li49' style='font-weight:bold;'>Italian <a href='index.php?category_id=50'>(21615 books, 0 subcategories)</a></font></li> <li><font id='li50' style='font-weight:bold;'>Latin <a href='index.php?category_id=51'>(21522 books, 0 subcategories)</a></font></li> <li><font id='li51' style='font-weight:bold;'>Polish <a href='index.php?category_id=52'>(21721 books, 0 subcategories)</a></font></li> <li><font id='li52' style='font-weight:bold;'>Portuguese <a href='index.php?category_id=53'>(21330 books, 0 subcategories)</a></font></li> <li><font id='li53' style='font-weight:bold;'>Romanian <a href='index.php?category_id=54'>(21367 books, 0 subcategories)</a></font></li> <li><font id='li54' style='font-weight:bold;'>Serbian <a href='index.php?category_id=55'>(21835 books, 0 subcategories)</a></font></li> <li><font id='li55' style='font-weight:bold;'>Slavonic <a href='index.php?category_id=56'>(21324 books, 0 subcategories)</a></font></li> <li><font id='li56' style='font-weight:bold;'>Spanish <a href='index.php?category_id=57'>(21520 books, 0 subcategories)</a></font></li> <li><font id='li57' style='font-weight:bold;'>Swedish <a href='index.php?category_id=58'>(21800 books, 0 subcategories)</a></font></li> <li><font id='li58' style='font-weight:bold;'>Syriac <a href='index.php?category_id=59'>(21474 books, 0 subcategories)</a></font></li> <li><font id='li59' style='font-weight:bold;'>Thai <a href='index.php?category_id=60'>(21734 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li60' style='font-weight:bold;'>History <a href='index.php?category_id=61'>(216103 books, 9 subcategories)</a></font> <ul> <li><font id='li61' style='font-weight:bold;'>Ancient <a href='index.php?category_id=62'>(21659 books, 0 subcategories)</a></font></li> <li><font id='li62' style='font-weight:bold;'>Church <a href='index.php?category_id=63'>(21394 books, 0 subcategories)</a></font></li> <li><font id='li63' style='font-weight:bold;'>England <a href='index.php?category_id=64'>(21868 books, 0 subcategories)</a></font></li> <li><font id='li64' style='font-weight:bold;'>Ethnology <a href='index.php?category_id=65'>(21681 books, 0 subcategories)</a></font></li> <li><font id='li65' style='font-weight:bold;'>Jewish <a href='index.php?category_id=66'>(21744 books, 0 subcategories)</a></font></li> <li><font id='li66' style='font-weight:bold;'>Memoirs <a href='index.php?category_id=67'>(21381 books, 0 subcategories)</a></font></li> <li><font id='li67' style='font-weight:bold;'>World War I <a href='index.php?category_id=68'>(21673 books, 0 subcategories)</a></font></li> <li><font id='li68' style='font-weight:bold;'>World War II <a href='index.php?category_id=69'>(21737 books, 0 subcategories)</a></font></li> <li><font id='li69' style='font-weight:bold;'>Science <a href='index.php?category_id=70'>(21440 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li70' style='font-weight:bold;'>Manuscripts <a href='index.php?category_id=71'>(21770 books, 0 subcategories)</a></font></li> <li><font id='li71' style='font-weight:bold;'>Philosophy <a href='index.php?category_id=72'>(86201 books, 3 subcategories)</a></font> <ul> <li><font id='li72' style='font-weight:bold;'>Ancient <a href='index.php?category_id=73'>(21591 books, 0 subcategories)</a></font></li> <li><font id='li73' style='font-weight:bold;'>Mystics <a href='index.php?category_id=74'>(21506 books, 0 subcategories)</a></font></li> <li><font id='li74' style='font-weight:bold;'>Modern <a href='index.php?category_id=75'>(21532 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li75' style='font-weight:bold;'>Religions <a href='index.php?category_id=76'>(258868 books, 11 subcategories)</a></font> <ul> <li><font id='li76' style='font-weight:bold;'>Bible <a href='index.php?category_id=77'>(86249 books, 3 subcategories)</a></font> <ul> <li><font id='li77' style='font-weight:bold;'>Editions <a href='index.php?category_id=78'>(21569 books, 0 subcategories)</a></font></li> <li><font id='li78' style='font-weight:bold;'>Commentaries <a href='index.php?category_id=79'>(21521 books, 0 subcategories)</a></font></li> <li><font id='li79' style='font-weight:bold;'>Textual Criticism <a href='index.php?category_id=80'>(21563 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li80' style='font-weight:bold;'>A Course in Miracles <a href='index.php?category_id=81'>(21489 books, 0 subcategories)</a></font></li> <li><font id='li81' style='font-weight:bold;'>Egyptian <a href='index.php?category_id=82'>(21647 books, 0 subcategories)</a></font></li> <li><font id='li82' style='font-weight:bold;'>Koran <a href='index.php?category_id=83'>(21599 books, 0 subcategories)</a></font></li> <li><font id='li83' style='font-weight:bold;'>Mysteries <a href='index.php?category_id=84'>(21758 books, 0 subcategories)</a></font></li> <li><font id='li84' style='font-weight:bold;'>Oahspe <a href='index.php?category_id=85'>(21510 books, 0 subcategories)</a></font></li> <li><font id='li85' style='font-weight:bold;'>Talmud <a href='index.php?category_id=86'>(21416 books, 0 subcategories)</a></font></li> <li><font id='li86' style='font-weight:bold;'>Urantia <a href='index.php?category_id=87'>(21648 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li87' style='font-weight:bold;'>Science <a href='index.php?category_id=88'>(1617752 books, 74 subcategories)</a></font> <ul> <li><font id='li88' style='font-weight:bold;'>Chess <a href='index.php?category_id=89'>(21367 books, 0 subcategories)</a></font></li> <li><font id='li89' style='font-weight:bold;'>Physics <a href='index.php?category_id=90'>(388844 books, 17 subcategories)</a></font> <ul> <li><font id='li90' style='font-weight:bold;'>Astronomy <a href='index.php?category_id=91'>(21810 books, 0 subcategories)</a></font></li> <li><font id='li91' style='font-weight:bold;'>Cosmology <a href='index.php?category_id=92'>(21585 books, 0 subcategories)</a></font></li> <li><font id='li92' style='font-weight:bold;'>Electrodynamics <a href='index.php?category_id=93'>(21667 books, 0 subcategories)</a></font></li> <li><font id='li93' style='font-weight:bold;'>Courses <a href='index.php?category_id=94'>(65174 books, 2 subcategories)</a></font> <ul> <li><font id='li94' style='font-weight:bold;'>General Physics <a href='index.php?category_id=95'>(21914 books, 0 subcategories)</a></font></li> <li><font id='li95' style='font-weight:bold;'>Theoretical Physics <a href='index.php?category_id=96'>(21422 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li96' style='font-weight:bold;'>Experimental <a href='index.php?category_id=97'>(21365 books, 0 subcategories)</a></font></li> <li><font id='li97' style='font-weight:bold;'>General Relativity <a href='index.php?category_id=98'>(21551 books, 0 subcategories)</a></font></li> <li><font id='li98' style='font-weight:bold;'>Kinetic Theory <a href='index.php?category_id=99'>(21600 books, 0 subcategories)</a></font></li> <li><font id='li99' style='font-weight:bold;'>Quantum Mechanics <a href='index.php?category_id=100'>(21438 books, 0 subcategories)</a></font></li> <li><font id='li100' style='font-weight:bold;'>Quantum Field Theory <a href='index.php?category_id=101'>(21416 books, 0 subcategories)</a></font></li> <li><font id='li101' style='font-weight:bold;'>Reference <a href='index.php?category_id=102'>(21602 books, 0 subcategories)</a></font></li> <li><font id='li102' style='font-weight:bold;'>Statistical Physics <a href='index.php?category_id=103'>(21727 books, 0 subcategories)</a></font></li> <li><font id='li103' style='font-weight:bold;'>Optics <a href='index.php?category_id=104'>(21454 books, 0 subcategories)</a></font></li> <li><font id='li104' style='font-weight:bold;'>Popular <a href='index.php?category_id=105'>(21698 books, 0 subcategories)</a></font></li> <li><font id='li105' style='font-weight:bold;'>Mechanics <a href='index.php?category_id=106'>(21610 books, 0 subcategories)</a></font></li> <li><font id='li106' style='font-weight:bold;'>Quantum Gravity <a href='index.php?category_id=107'>(21514 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li107' style='font-weight:bold;'>Biology <a href='index.php?category_id=108'>(21485 books, 0 subcategories)</a></font></li> <li><font id='li108' style='font-weight:bold;'>Economics <a href='index.php?category_id=109'>(21321 books, 0 subcategories)</a></font></li> <li><font id='li109' style='font-weight:bold;'>Guns <a href='index.php?category_id=110'>(21484 books, 0 subcategories)</a></font></li> <li><font id='li110' style='font-weight:bold;'>Law <a href='index.php?category_id=111'>(86287 books, 3 subcategories)</a></font> <ul> <li><font id='li111' style='font-weight:bold;'>Ancient <a href='index.php?category_id=112'>(21760 books, 0 subcategories)</a></font></li> <li><font id='li112' style='font-weight:bold;'>Corporate <a href='index.php?category_id=113'>(21555 books, 0 subcategories)</a></font></li> <li><font id='li113' style='font-weight:bold;'>Criminal <a href='index.php?category_id=114'>(21461 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li114' style='font-weight:bold;'>Medicine <a href='index.php?category_id=115'>(64763 books, 2 subcategories)</a></font> <ul> <li><font id='li115' style='font-weight:bold;'>Cardiology <a href='index.php?category_id=116'>(21338 books, 0 subcategories)</a></font></li> <li><font id='li116' style='font-weight:bold;'>Toxicology <a href='index.php?category_id=117'>(21697 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li117' style='font-weight:bold;'>Mind <a href='index.php?category_id=118'>(21798 books, 0 subcategories)</a></font></li> <li><font id='li118' style='font-weight:bold;'>Music <a href='index.php?category_id=119'>(21659 books, 0 subcategories)</a></font></li> <li><font id='li119' style='font-weight:bold;'>Programming <a href='index.php?category_id=120'>(473889 books, 21 subcategories)</a></font> <ul> <li><font id='li120' style='font-weight:bold;'>Android <a href='index.php?category_id=121'>(21496 books, 0 subcategories)</a></font></li> <li><font id='li121' style='font-weight:bold;'>SQL <a href='index.php?category_id=122'>(21504 books, 0 subcategories)</a></font></li> <li><font id='li122' style='font-weight:bold;'>PHP and MySQL <a href='index.php?category_id=123'>(21577 books, 0 subcategories)</a></font></li> <li><font id='li123' style='font-weight:bold;'>Hadoop <a href='index.php?category_id=124'>(21537 books, 0 subcategories)</a></font></li> <li><font id='li124' style='font-weight:bold;'>The Art of Computer Science <a href='index.php?category_id=125'>(21665 books, 0 subcategories)</a></font></li> <li><font id='li125' style='font-weight:bold;'>C <a href='index.php?category_id=126'>(21226 books, 0 subcategories)</a></font></li> <li><font id='li126' style='font-weight:bold;'>C++ <a href='index.php?category_id=127'>(21476 books, 0 subcategories)</a></font></li> <li><font id='li127' style='font-weight:bold;'>Java <a href='index.php?category_id=128'>(21889 books, 0 subcategories)</a></font></li> <li><font id='li128' style='font-weight:bold;'>JavaScript <a href='index.php?category_id=129'>(21680 books, 0 subcategories)</a></font></li> <li><font id='li129' style='font-weight:bold;'>Neural Networks <a href='index.php?category_id=130'>(21523 books, 0 subcategories)</a></font></li> <li><font id='li130' style='font-weight:bold;'>Cryptography <a href='index.php?category_id=131'>(21636 books, 0 subcategories)</a></font></li> <li><font id='li131' style='font-weight:bold;'>Compilers <a href='index.php?category_id=132'>(21493 books, 0 subcategories)</a></font></li> <li><font id='li132' style='font-weight:bold;'>Graphics <a href='index.php?category_id=133'>(21228 books, 0 subcategories)</a></font></li> <li><font id='li133' style='font-weight:bold;'>TeX <a href='index.php?category_id=134'>(21356 books, 0 subcategories)</a></font></li> <li><font id='li134' style='font-weight:bold;'>Computer Algebra Systems <a href='index.php?category_id=135'>(107931 books, 4 subcategories)</a></font> <ul> <li><font id='li135' style='font-weight:bold;'>Mathematica <a href='index.php?category_id=136'>(21656 books, 0 subcategories)</a></font></li> <li><font id='li136' style='font-weight:bold;'>Maple <a href='index.php?category_id=137'>(21400 books, 0 subcategories)</a></font></li> <li><font id='li137' style='font-weight:bold;'>REDUCE <a href='index.php?category_id=138'>(21778 books, 0 subcategories)</a></font></li> <li><font id='li138' style='font-weight:bold;'>Maxima <a href='index.php?category_id=139'>(21247 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li139' style='font-weight:bold;'>Unix <a href='index.php?category_id=140'>(21653 books, 0 subcategories)</a></font></li> <li><font id='li140' style='font-weight:bold;'>Algorithms <a href='index.php?category_id=141'>(21557 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li141' style='font-weight:bold;'>Mathematics <a href='index.php?category_id=142'>(453375 books, 20 subcategories)</a></font> <ul> <li><font id='li142' style='font-weight:bold;'>Analysis <a href='index.php?category_id=143'>(107888 books, 4 subcategories)</a></font> <ul> <li><font id='li143' style='font-weight:bold;'>Real Analysis <a href='index.php?category_id=144'>(21738 books, 0 subcategories)</a></font></li> <li><font id='li144' style='font-weight:bold;'>Complex Analysis <a href='index.php?category_id=145'>(21590 books, 0 subcategories)</a></font></li> <li><font id='li145' style='font-weight:bold;'>Functional Analysis <a href='index.php?category_id=146'>(21547 books, 0 subcategories)</a></font></li> <li><font id='li146' style='font-weight:bold;'>Variational Calculus <a href='index.php?category_id=147'>(21489 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li147' style='font-weight:bold;'>Algebra <a href='index.php?category_id=148'>(43149 books, 1 subcategories)</a></font> <ul> <li><font id='li148' style='font-weight:bold;'>Geometric Algebra <a href='index.php?category_id=149'>(21604 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li149' style='font-weight:bold;'>Categories <a href='index.php?category_id=150'>(21399 books, 0 subcategories)</a></font></li> <li><font id='li150' style='font-weight:bold;'>Geometry <a href='index.php?category_id=151'>(42982 books, 1 subcategories)</a></font> <ul> <li><font id='li151' style='font-weight:bold;'>Algebraic Geometry <a href='index.php?category_id=152'>(21380 books, 0 subcategories)</a></font></li> </ul> </li> <li><font id='li152' style='font-weight:bold;'>Discrete <a href='index.php?category_id=153'>(21639 books, 0 subcategories)</a></font></li> <li><font id='li153' style='font-weight:bold;'>Set Theory <a href='index.php?category_id=154'>(21501 books, 0 subcategories)</a></font></li> <li><font id='li154' style='font-weight:bold;'>Topology <a href='index.php?category_id=155'>(21623 books, 0 subcategories)</a></font></li> <li><font id='li155' style='font-weight:bold;'>Graph Theory <a href='index.php?category_id=156'>(21853 books, 0 subcategories)</a></font></li> <li><font id='li156' style='font-weight:bold;'>Number Theory <a href='index.php?category_id=157'>(21764 books, 0 subcategories)</a></font></li> <li><font id='li157' style='font-weight:bold;'>Logic <a href='index.php?category_id=158'>(21500 books, 0 subcategories)</a></font></li> <li><font id='li158' style='font-weight:bold;'>Popular <a href='index.php?category_id=159'>(21521 books, 0 subcategories)</a></font></li> <li><font id='li159' style='font-weight:bold;'>Probability <a href='index.php?category_id=160'>(21618 books, 0 subcategories)</a></font></li> <li><font id='li160' style='font-weight:bold;'>Differential Equations <a href='index.php?category_id=161'>(21591 books, 0 subcategories)</a></font></li> <li><font id='li161' style='font-weight:bold;'>Dynamical Systems <a href='index.php?category_id=162'>(21615 books, 0 subcategories)</a></font></li> </ul> </li> </ul> </li> </ul> </li> </ul>
tigran123 commented 9 years ago

Oops, I see that id went into the 'font' rather than 'li' element!!! Sorry, I'll fix that and re-test now...

simonexmachina commented 9 years ago

Yup, that'll be it :) Hey, while you're at it you should consider using CSS rather than those <font> tags too :)

tigran123 commented 9 years ago

Yes, you are absolutely right! :) It works now! Thank you very much. Yes, I'll get rid of those ugly <font> things too, thank you. Closing the issue now.

simonexmachina commented 9 years ago

Excellent, glad its working for you.