zoukankan      html  css  js  c++  java
  • 测试代码折叠

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'index.jsp' starting page</title>
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
        <script type="text/javascript">
            function createXmlHttpRequest(){
                try{
                    return new XMLHttpRequest();
                }catch(e){
                    try{
                        return new ActiveXObject("Msxml2.XMLHTTP");
                    }catch(e){
                        try{
                            return new ActiveXObject("Micorsoft.XMLHTTP");
                        }catch(e){
                            throw e;
                        }
                    }
                }
            }
            window.onload = function(){
                var btn = document.getElementById("btn");
                btn.onclick = function(){
                    
                var xmlHttp = createXmlHttpRequest();
                xmlHttp.open("GET", "/ajaxdemo/AServlet",true);
                xmlHttp.send(null);
                xmlHttp.onreadystatechange = function(){
                    if(xmlHttp.status == 200 && xmlHttp.readyState == 4){
                        var text = xmlHttp.responseText;
                        var h1 = document.getElementById("h1");
                        h1.innerHTML = text;
                    }
                }
            }
        }
                
        </script>
      </head>
      
      <body>
        <button id="btn">点击这里</button>
        <h1 id="h1"></h1>
      </body>
    </html>
    Demo.html
  • 相关阅读:
    padding magin 盒子模型
    background元素背景--font字体
    border 边框
    浅析mvvm模式和mvc模式的区别和联系
    Win10下小米路由器4A百兆版刷Openwrt固件【图片详细版】
    Vue源码-手写mustache源码
    微信小程序支付实现流程
    Fiddler对安卓模拟器中的app抓包
    Niginx中Vue Router 历史(history)模式的配置
    ES6中Promise方法详解
  • 原文地址:https://www.cnblogs.com/csong7876/p/7736099.html
Copyright © 2011-2022 走看看