javascript| algorithm through ASP dynamic generation of JS array, and then JS in the client to arrange, the largest reduction of server-side pressure. (Server-side only query once, no other action)
Database design:
ID: Index, AutoNumber
Mc:varchar 100 bytes, record category name
FL: number, records belong to which category, 0 is the root category
CEng: Number, records in the number of layers of the root classification of 0 layer, then increase by 1
The generated HTML code is as follows:
fenlei
The server-side ASP code is as follows:
fenlei
Explain:
ASP query database, generate JS data object (not array, similar)
Database of different rows, corresponding to different temparray[0] temparray[1] ...
Different fields are segmented by "@_!_#_$_|_@" in each piece of data to avoid duplication with the text in the data.
Using JS to rearrange temparray by recursion algorithm to get dataarray and to cycle Print to option in select