View Full Version : folding tree and ajax

10-28-2005, 08:05 PM
I'm using ajax to render a sub category for the folding tree meny, but I get an Error in IE when I do that. Everything works fine FF.
When I load a tree with ajax, I cannot expand the subcategories. Ajax fires, but the tree does not open giving me the error style is null..

var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0];
foldercontent is undefined in IE. Firefox works like a charm.

<li id="foldheader">
<a href="javascript:void(0);" onClick="Load_SubCat(1,2,3,'mysection'');">
<ul id="foldinglist" style="display:none;" style=&{head};>
<div id="mysection"></div>
I use innerHTML to populate the div with the html for a sub category, which I think it does but it does not open to display it.

If i just use a static tree, all is fine, it's only when I dynamically load a sub category.

10-28-2005, 09:36 PM
I had to remove that script and use nextSibling instead.
Basically in each li I added an onclick with a function call to <li onclick="toggleDiv(this);"> (speaking of which..im not toggling a div :) )

function toggleDiv(el)
then I just used nextSibling.style.display for IE
and nextSibling.nextSibling.style.display fror FF.