- var XMLHttpReq;
- function createXMLHttpRequest() {
- try {
- XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch(E) {
- try {
- XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
- }
- catch(E) {
- XMLHttpReq = new XMLHttpRequest();
- }
- }
-
- }
- function sendAjaxRequest(url) {
- createXMLHttpRequest();
- XMLHttpReq.open("post", url, true);
- XMLHttpReq.onreadystatechange = processResponse;
- XMLHttpReq.send(null);
- }
- function processResponse() {
- if (XMLHttpReq.readyState == 4) {
- if (XMLHttpReq.status == 200) {
- var text = XMLHttpReq.responseText;
-
-
- text = window.decodeURI(text);
- var cp = document.getElementById("cp");
- cp.innerHTML = "";
- var values = text.split("|");
- for (var i = 0; i < values.length; i++) {
- var temp = document.createElement("option");
- temp.text = values[i];
- temp.value = values[i];
- cp.options.add(temp);
- }
-
-
- }
- }
-
- }
posted @
2016-05-11 13:47
susanws
阅读(
230)
评论()
编辑
收藏
举报