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:
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 );