zoukankan      html  css  js  c++  java
  • ajax 第一节

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
       
    <script src="js/jquery-1.8.2.min.js"></script>
        <script type="text/javascript">
    
            $(function () {
    
    
                $("#btn").click(
                           function () {
                           
    
                               if (XMLHttpRequest) {
    
    
                                   var xhr = new XMLHttpRequest();
    
                               }
                               else {
    
                                   //ie  5 6 
    xhr = new ActiveXObject("Microsoft.XMLHTTP"); } xhr.open("get", "handler1.ashx?r=1", true); xhr.send(); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { if (xhr.status == 200) { $("#test1").val(xhr.responseText); } } } } ) }) </script> </head> <body> <input type="button" id="btn" value="ajax"/> <input type="text" id="test1" value="3" /> </body> </html>

    一般处理程序 页 :

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    
    namespace WebApplication2
    {
        /// <summary>
        /// Handler1 的摘要说明
        /// </summary>
        public class Handler1 : IHttpHandler
        {
    
            public void ProcessRequest(HttpContext context)
            {
                context.Response.ContentType = "text/plain";
                context.Response.Write(DateTime.Now.Millisecond);
            }
    
            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }
        }
    }
  • 相关阅读:
    linux内核启动汇编部分详解
    linux内核zImage详解
    Linux内核zImage怎么来的?
    Linux内核编译make做了什么?
    关于makefile的几点经验
    note
    tmp0000
    tmp
    SSL学习与总结
    C++学习笔记
  • 原文地址:https://www.cnblogs.com/xh0626/p/5005265.html
Copyright © 2011-2022 走看看