-
js纯ajax
- 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);
- }
-
-
- }
- }
-
- }
-
相关阅读:
js 获取时间差
linq 两个list合并处理,并分组
单例模式 双锁
2018年的读书清单
感悟
asp.net使用Microsoft.mshtml提取网页标题等解析网页
//利用反射快速给Model实体赋值
C# url接口调用
多字段动态查询
对图片的操作
-
原文地址:https://www.cnblogs.com/susanws/p/5481611.html
Copyright © 2020-2023
润新知