XML volume actual combat kit (4): menu

xiaoxiao2021-03-06  106

[Zoom and narrow the comment close]

Motivation: Now we have a small example of applying XML in IE: Solve the link between dual pull ordering. Everyone is the most common possibility is to select the example of changing the city option after the province. Let's try to complete it with XML.

Some of the features mentioned in the previous introduction I have done directly with the XML XSL file. You may not be very familiar with it, so I use HMTL XML this time, I hope everyone knows more clearly - " XML can be so simple! ":)

Material: XML volume menu with 2 files: citys.xml and cityselect.htm

Role: After selecting the province, you can automatically display the corresponding city, so that users can effectively improve data interaction, so that their pages are more beautiful. Effect: Browse here: city.xml Jiujiang Nanchang 庐山 Jingdezhen Beijing West Juyongguan Tsinghua Park Zhoukou shop Lanzhou Luomen Jiayuguan Guangzhou Shenzhen Dongguan Shipai Hefei Huangshan Kowloon Maanshan

Cityselect.htm

Custom Function: ChooseState (Name of the province in XML data, adding to selstate's drop-down list) Function Choosestate () {var source; var source; var source = new activXObject ('Microsoft .Xmldom '); // Create a MSXML parser instance source.async = false; source.load (source (source); // Load XML document root = source.documentelement; // Set document element is root node element Sortfield = root .selectnodes ("@ name"); // Search all node for (var i = 0; i = 0; - I) // Undo the original list {Form1. SELCITY.Options.Remove (i)} f OR (var i = 0; i

Form source code

CopyRight © 2020 All Rights Reserved
Processed: 0.045, SQL: 9