01.
02.
function
get_XmlHttp() {
03.
04.
var
xmlHttp =
null
;
05.
06.
if
(window.XMLHttpRequest) { xmlHttp =
new
XMLHttpRequest(); }
07.
else
if
(window.ActiveXObject) { xmlHttp =
new
ActiveXObject(
"Microsoft.XMLHTTP"
); }
08.
09.
10.
11.
if
(xmlHttp ==
null
) alert(
'your browser does not support jaavscript'
);
12.
return
xmlHttp;
13.
}
14.
15.
function
getCity(){
16.
17.
var
country_id = document.getElementById(
"country_id"
).value;
18.
var
xmlhttp = get_XmlHttp();
19.
if
(xmlhttp ==
null
){
20.
return
;
21.
}
22.
xmlhttp.onreadystatechange =
function
() {
23.
if
(xmlhttp.readyState==4) {
24.
if
(xmlhttp.status==200) {
25.
var
wrappingElement = document.createElement(
'div'
);
26.
wrappingElement.innerHTML = xmlhttp.responseText;
27.
var
e = document.getElementById(
'city'
);
28.
e.innerHTML =
""
;
29.
e.innerText =
""
;
30.
31.
e.appendChild(wrappingElement);
32.
33.
34.
}
35.
}
36.
};
37.
xmlhttp.open(
"GET"
,
"search_city_search.php?mode=select_city&country_id="
+country_id,
true
);
38.
xmlhttp.send();
39.
40.
}
41.
42.
function
getCity_add(){
43.
var
country_id = document.getElementById(
"country_id_add"
).value;
44.
var
xmlhttp = get_XmlHttp();
45.
if
(xmlhttp ==
null
){
46.
return
;
47.
}
48.
xmlhttp.onreadystatechange =
function
() {
49.
if
(xmlhttp.readyState==4) {
50.
if
(xmlhttp.status==200) {
51.
var
wrappingElement = document.createElement(
'div'
);
52.
wrappingElement.innerHTML = xmlhttp.responseText;
53.
var
e = document.getElementById(
'city_add'
);
54.
e.innerHTML =
""
;
55.
e.innerText =
""
;
56.
57.
e.appendChild(wrappingElement);
58.
59.
60.
}
61.
}
62.
};
63.
xmlhttp.open(
"GET"
,
"search_city.php?mode=select_city&country_id="
+country_id,
true
);
64.
xmlhttp.send();
65.
66.
}
67.
68.
function
getCity_Export(){
69.
70.
var
country_id = document.getElementById(
"country_id"
).value;
71.
var
xmlhttp = get_XmlHttp();
72.
if
(xmlhttp ==
null
){
73.
return
;
74.
}
75.
xmlhttp.onreadystatechange =
function
() {
76.
if
(xmlhttp.readyState==4) {
77.
if
(xmlhttp.status==200) {
78.
var
wrappingElement = document.createElement(
'div'
);
79.
wrappingElement.innerHTML = xmlhttp.responseText;
80.
var
e = document.getElementById(
'city'
);
81.
e.innerHTML =
""
;
82.
e.innerText =
""
;
83.
84.
e.appendChild(wrappingElement);
85.
86.
87.
}
88.
}
89.
};
90.
xmlhttp.open(
"GET"
,
"search_city_export.php?mode=select_city&country_id="
+country_id,
true
);
91.
xmlhttp.send();
92.
93.
}