随笔分类 - web_AspNet
摘要://1创建对象 XMLHttpRequest var request = createXHR(); function createXHR() {//判断浏览器兼容 var xhr; if (XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } return xhr; } function send() { document.getElementById("d").innerHTML = "加载中
阅读全文
摘要:--ajax 笔记.一.XMLHttpRequest1.创 new 2.请求 open 3.注册 onreadyState 4.发送 send二.html静态页面执行速度快于动态页面.三.ajax 请求常见问题1.中文乱码 ->通过 编码解决.2.浏览器缓存->通过参数+Math.random()方法,2.2设置请求头3.解决服务器不可预知的错误.->readyState 是xmlhttpRequest对象状态码. status 是http响应的状态码
阅读全文
摘要:using System;using System.Web;using System.IO;public class add : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/html"; int n = 0; //第一步,读取静态页面. string path = context.Request.MapPath("01add.htm"); string html = File.ReadAllTe
阅读全文
摘要:using System;using System.Web;using System.Text;public class Search : IHttpHandler{ /// /// 处理http请求 /// /// 请求上下文(浏览器request上文,服务器response是下文) public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; //接受请求 var name = context.Request.QueryString["
阅读全文
摘要://1.获取到数据方式一 test //2方式二 //3.方式三用原生javascript做.
阅读全文

浙公网安备 33010602011771号