I saw some new linkage controls on the Internet. After the test, English and numbers are displayed, but Chinese characters are not displayed. Later, I made a flip-over modification to the files that have been down from the Internet and made a linkage control for provinces and cities. Share it with you. Chinese characters are displayed.
Function load (state ){
Var drp2 = document. getElementById ("DropDownList2 ");
For (I = drp2.length; I & gt; = 0; I --){
Drp2.options. remove (I );
}
Var oHttpReq = new ActiveXObject ("MSXML2.XMLHTTP ");
Var oDoc = new ActiveXObject ("MSXML2.DOMDocument ");
// Here escape can solve Chinese problems
OHttpReq. open ("POST", "getData. aspx? State = "+ state, false );
OHttpReq. send ("");
Result = oHttpReq. responseText;
ODoc. loadXML (result );
Items1 = oDoc. selectNodes ("// CITY/Table/Id ");
Items2 = oDoc. selectNodes ("// CITY/Table/shiname ");
Var itemsLength = items1.length;
For (I = 0; I & lt; itemsLength; I ++)
// Assign the class name and number of the sub-class to DropDownList2
{
Var newOption = document. createElement ("OPTION ");
NewOption. text = items2 [I]. text;
NewOption. value = items1 [I]. text;
Drp2.options. add (newOption );
}
}
Window. onload = function () {load ('1 ');}
<% @ Page language = "c #" Codebehind = "Example. aspx. cs" AutoEventWireup = "false" Inherits = "Webs. other. Example" %>
<HTML>
<HEAD>
<Title> Example </title>
<Meta name = "GENERATOR" Content = "Microsoft Visual Studio. NET 7.1">
<Meta name = "CODE_LANGUAGE" Content = "C #">