DHTML + XML + ASP + CSS = tree directory

Source: Internet
Author: User
Tree directory display program
Problem description:
In our project, we often see self-associated data tables. If we look at the whole table as a tree data structure (for complex situations, it may become a graph ). When we display and edit this table, if we do not adopt a good expression, it will be very clumsy. For this reason, we develop such a tree structure program. In the previous version, we used recursive algorithms for implementation. During our evaluation of this algorithm, we found that databases with thousands of records are no longer competent, therefore, in the new algorithm version, we use XML technology to dynamically discover data to solve the embarrassment of a large amount of data on the slave server, at the same time, it does not mean that if the table data structure is displayed as a graph, it will enter an endless loop error.
Practical ideas:
1. Initially, only the root and secondary nodes are displayed, and the root and secondary nodes are at the same level.
2. Click a node. If its subnode region object does not exist, the object is created and data update data is downloaded. All subnodes are displayed.
3. Each node has the same function after it is created, such as checking whether the subnode exists or hiding the subnode.
4. DHTML + XML + ASP + CSS
Technical difficulties:
1. Garbled characters when using the xmlhttp interface:
Because the default encoding scheme on the asp output page is not Chinese, the default scheme will be used for parsing in xmlhttp on the client page, so garbled characters will appear. To this end, we add the following code to the asp page of the Server to define the encoding scheme:
Response. CharSet = "GB2312"
Response. ContentType = "text/html"
2. How to maintain the style of the previous version on the interface (in the form of resource manager ):
In the previous version, all the page content was in one go, and the concept of recursion was adopted in control. Sometimes the interface was relatively friendly, and the mechanism of the current version was changed, the content is merged multiple times.
Key question: how can I determine the id of an img or span object?
After verification, the current version of the interface is difficult to be the same as the first interface, so only part of the interface can be retained, but in general, the new interface can also meet the needs
Because attachments are not easy to use here, you can only paste the source code:
---Xtree.html -------------------------------------------------------------------
<HTML>
<HEAD>
<Meta name = "GENERATOR" Content = "Microsoft Visual Studio 6.0">
<Script language = javascript src = "xtree. js">
</SCRIPT>
<Style type = "text/css">
<! --
A: link {font-size: 14px; text-decoration: none; color: # 0000FF}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.