Problem description: jquery uses jstree to dynamically generate a tree. If there are more than 500 directories under a node, ie will prompt whether JavaScript scripts are allowed to run and the contents are not fully loaded, it only loads about 300.
Solution: The generated tree is loaded step by step. There is a code for generating nodes in the open function:
Code
For (VAR I = 0; I <data. length; I ++)
{
VaR n = tree_obj.create (data [I], $ (node ));
If (onaddnode) onaddnode (N );
}
VaR firstchild = tree_obj.children (node) [0];
If ($ (firstchild). ATTR ('id') =-1)
Tree_obj.remove (firstchild );
The problem arises from the tree_obj.create function, which consumes a lot of performance. The code is changed to the following:
Code
VaR children = "";
For (VAR I = 0; I <data. length; I ++)
{
Children + = tree_obj.parsejson (data [I]);
}
If (children! = "")
Certificate (node).children('ul'0000.html (children );
VaR firstchild = tree_obj.children (node) [0];
If ($ (firstchild). ATTR ('id') =-1)
Tree_obj.remove (firstchild );