JavaScript: JSP + AJAX & nbsp; add or delete multiple selection boxes, Javascript tutorial
In this example, JSP + Ajax + text is used to demonstrate the effects of multiple select, all select, add, delete, and update checkbox multiple select boxes; fully demonstrates the use of JavaScript to control html dom and the use of XML http to transmit data, and the use of JSP to operate on text.
1. JavaScript is used to control the reality of page content and add and delete results;
2. Use JSP as the background to read, write, and update text;
3. text format is used to store data, data encoding UTF-8; 4, this example in win32, Red hat Linux 9 jdk1.5, Tomcat 5.0, Apache 2.5 debugging through, while compatible with Firefox 1.0, opera 8.0, IE6.
Advantages of this example:
1. Create an html object in real time, and add or delete the WYSIWYG page. The display speed is faster and the user experience is increased.
2. XML http transmits data only as an id or form value, saving bandwidth.
3. This example is suitable for XML http, so this effect is highly practical, but JS/JSP code is very simple.
4. There are many things that can be used in other projects and solve the problem of Chinese character encoding in operating texts. (This example runs in the Chinese operating system, so the GBK encoding is selected, if the OS is English, it needs to be processed separately, such as encoding to UTF-8, or according to the need to convert the encoding .)
5. You can drag and drop files or expand or close files. You can use cookies to record the location and enable or disable the files.
6. There are rich comments for beginners to explore together.
Disadvantages:
1. Maintenance debugging is troublesome. Is it worth doing so for this effect? If you embed an iframe in a normal way, will it work.
2. The code is not optimized or abbreviated, and sometimes redundant.
3. The interaction design is not well done. Here we mainly show the technical implementation and communication.
Source File: Click to download