Selaa lähdekoodia

1103 补充web前端代码和xml代码

Demi 7 kuukautta sitten
vanhempi
commit
42cfe435af
65 muutettua tiedostoa jossa 2346 lisäystä ja 0 poistoa
  1. 54 0
      web-demo/learn-css/01-inline.html
  2. 33 0
      web-demo/learn-css/02-style.html
  3. 22 0
      web-demo/learn-css/03-outside.html
  4. 92 0
      web-demo/learn-css/04-button.html
  5. 46 0
      web-demo/learn-css/05-float.html
  6. 48 0
      web-demo/learn-css/06-positon.html
  7. 51 0
      web-demo/learn-css/07-box.html
  8. 9 0
      web-demo/learn-css/css/button.css
  9. 22 0
      web-demo/learn-html/01-h.html
  10. 15 0
      web-demo/learn-html/02-p.html
  11. 25 0
      web-demo/learn-html/03-ol.html
  12. 37 0
      web-demo/learn-html/04-ul.html
  13. 37 0
      web-demo/learn-html/05-a.html
  14. 21 0
      web-demo/learn-html/06-img.html
  15. 18 0
      web-demo/learn-html/07-audio.html
  16. 19 0
      web-demo/learn-html/08-video.html
  17. 66 0
      web-demo/learn-html/09-table.html
  18. 64 0
      web-demo/learn-html/10-form.html
  19. 50 0
      web-demo/learn-html/11-form-1.html
  20. 29 0
      web-demo/learn-html/12-div.html
  21. 16 0
      web-demo/learn-html/13-special.html
  22. 11 0
      web-demo/learn-html/base/test.html
  23. 15 0
      web-demo/learn-html/base1/test1.html
  24. 24 0
      web-demo/learn-html/day02/01-ref.html
  25. 21 0
      web-demo/learn-html/day02/02-color.html
  26. 87 0
      web-demo/learn-html/day02/03-table.html
  27. 34 0
      web-demo/learn-html/hello.html
  28. 1 0
      web-demo/learn-html/hello1.html
  29. BIN
      web-demo/learn-html/img/java.jpg
  30. BIN
      web-demo/learn-html/img/movie.mp4
  31. BIN
      web-demo/learn-html/img/music.mp3
  32. 14 0
      web-demo/learn-js/01-dom.html
  33. 21 0
      web-demo/learn-js/02-script.html
  34. 13 0
      web-demo/learn-js/03-outside.html
  35. 65 0
      web-demo/learn-js/04-if.html
  36. 58 0
      web-demo/learn-js/05-data.html
  37. 105 0
      web-demo/learn-js/06-opera.html
  38. 106 0
      web-demo/learn-js/07-arr.html
  39. 87 0
      web-demo/learn-js/08-obj.html
  40. 58 0
      web-demo/learn-js/09-for.html
  41. 29 0
      web-demo/learn-js/10-while.html
  42. 96 0
      web-demo/learn-js/11-map.html
  43. 36 0
      web-demo/learn-js/12-json.html
  44. 101 0
      web-demo/learn-js/13-event.html
  45. 56 0
      web-demo/learn-js/14-event-dom.html
  46. BIN
      web-demo/learn-js/img/java.jpg
  47. 3 0
      web-demo/learn-js/js/button.js
  48. 38 0
      xml-demo/.gitignore
  49. 8 0
      xml-demo/.idea/.gitignore
  50. 7 0
      xml-demo/.idea/encodings.xml
  51. 14 0
      xml-demo/.idea/misc.xml
  52. 124 0
      xml-demo/.idea/uiDesigner.xml
  53. 4 0
      xml-demo/.idea/vcs.xml
  54. 31 0
      xml-demo/pom.xml
  55. 20 0
      xml-demo/src/main/java/com/sf/App.java
  56. 35 0
      xml-demo/src/main/java/com/sf/LoginParam.java
  57. 26 0
      xml-demo/src/main/java/com/sf/Solution_209.java
  58. 34 0
      xml-demo/src/main/java/com/sf/Solution_904.java
  59. 71 0
      xml-demo/src/main/java/com/sf/properties/Test.java
  60. 66 0
      xml-demo/src/main/java/com/sf/xml/Test.java
  61. 7 0
      xml-demo/src/main/resources/jdbc.properties
  62. 3 0
      xml-demo/src/main/resources/sth.properties
  63. 9 0
      xml-demo/src/main/resources/student.dtd
  64. 23 0
      xml-demo/src/main/resources/student.xml
  65. 11 0
      xml-demo/src/main/resources/test.xml

+ 54 - 0
web-demo/learn-css/01-inline.html

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+
+    <input type="button" value="草率的按钮"/>
+    <br/>
+    <br/>
+    <!-- 行内式 使用css  inline代表行内 -->
+    <!-- 使用 属性style(风格) 来引入样式  样式名:样式值;样式名:样式值; ...  -->
+    <!--
+        width 宽度
+        height 高度
+        bg color 背景颜色
+        border 边框 + 宽度 + 线型 + 线的颜色
+        font-size 字体大小
+        font-family 字体
+        border-radius 边框的弧度 
+     -->
+    <!-- 缺点:html+css混在一起 样式只对当前的元素有效 -->
+    <input  type="button" value="按钮" 
+            style="
+                width: 60px;  
+                height: 40px;
+                background-color: bisque;
+                border: 1px solid yellowgreen;
+                font-size: 24px;
+                font-family: '隶书';
+                border-radius: 5px;
+            " 
+            />
+    <br/>
+    <br/>
+    <input  type="button" value="按钮" 
+            style="
+                width: 60px;  
+                height: 40px;
+                background-color: bisque;
+                border: 1px solid yellowgreen;
+                font-size: 24px;
+                font-family: '隶书';
+                border-radius: 5px;
+            " 
+            />      
+
+</body>
+
+</html>

+ 33 - 0
web-demo/learn-css/02-style.html

@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <!-- 将body中要使用的样式 抽取到head中 -->
+    <style>
+        /* 对input元素生效  这里是css的注释方式*/
+        input {
+            width: 60px;
+            height: 40px;
+            background-color: bisque;
+            border: 1px solid yellowgreen;
+            font-size: 22px;
+            font-family: '隶书';
+            border-radius: 5px;
+        }
+    </style>
+</head>
+
+<body>
+
+    <!-- 内嵌式 css -->
+    <!-- 缺点:生效范围在当前的html页面中 如果想要复用这个效果 在新的页面还需要复制一份 -->
+    <input type="button" value="按钮1" />
+    <br />
+    <br />
+    <input type="button" value="按钮2" />
+</body>
+
+</html>

+ 22 - 0
web-demo/learn-css/03-outside.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <!-- 连接到css文件 -->
+    <!-- 绝对地址 -->
+    <link href="/css/button.css" rel="stylesheet" type="text/css" /> 
+    <!-- 相对地址 -->
+    <!-- <link href="./css/button.css" rel="stylesheet" type="text/css" /> -->
+</head>
+<body>
+    
+    <!-- 外部样式表 outside -->
+    <input type="button" value="按钮1" />
+    <br />
+    <br />
+    <input type="button" value="按钮2" />
+
+</body>
+</html>

+ 92 - 0
web-demo/learn-css/04-button.html

@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <!-- 将body中要使用的样式 抽取到head中 -->
+    <style>
+        /* 对input元素生效  这里是css的注释方式*/
+        /* input {
+            width: 60px;
+            height: 40px;
+            background-color: bisque;
+            border: 1px solid yellowgreen;
+            font-size: 22px;
+            font-family: '隶书';
+            border-radius: 5px;
+        } */
+        /* 
+            元素选择器 
+            根据标签名找到要作用的范围
+        */
+
+        /*
+            id选择器
+            id是用来识别一个唯一元素的属性 id值是唯一的 
+         */
+        /* #btn2 {
+            width: 60px;
+            height: 40px;
+            background-color: bisque;
+            border: 1px solid yellowgreen;
+            font-size: 22px;
+            font-family: '隶书';
+            border-radius: 5px;
+        } */
+
+        /*
+            class选择器
+            根据元素class属性的值 确定作用范围
+            class属性 可以使用一个对应的样式 也可以使用多个
+         */
+        .shapeClass {
+            width: 60px;
+            height: 40px;
+            border-radius: 5px;
+        }
+
+        .colorClass {
+            background-color: bisque;
+            border: 1px solid yellowgreen;
+            color: red;
+        }
+
+        .fontClass {
+            font-size: 22px;
+            font-family: '隶书';
+        }
+
+        button {
+            padding: 5px 16px;
+            background-color: #f0f0f0;
+            border: none;
+            border-radius: 4px;
+            transition: background-color 0.3s ease;
+        }
+
+        button:active {
+            background-color: #007bff;
+            color: white;
+        }
+    </style>
+</head>
+
+<body>
+
+    <!-- 内嵌式 css -->
+    <!-- 缺点:生效范围在当前的html页面中 如果想要复用这个效果 在新的页面还需要复制一份 -->
+    <input id="btn1" class="shapeClass colorClass fontClass" type="button" value="按钮1" />
+    <br />
+    <br />
+    <input id="btn2" class="shapeClass" type="button" value="按钮2" />
+    <br />
+    <br />
+    <input id="btn3" class="fontClass" type="button" value="按钮3" />
+    <br />
+    <br />
+    <button id="btn4">按钮</button>
+</body>
+
+</html>

+ 46 - 0
web-demo/learn-css/05-float.html

@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    
+    <style>
+        .outerDiv{
+            width: 500px;
+            height: 303px;
+            border: 1px solid greenyellow;
+            background-color: rgb(165, 212, 212);
+        }
+        .innerDiv{
+            width: 100px;
+            height: 100px;
+            border: 1px solid rebeccapurple;
+            /* float: left; */
+        }
+        .d1{
+            background-color: bisque;
+            /* 使用float达到浮动的效果 right就是靠右 */
+            float: right;
+        }
+        .d2{
+            background-color: rgba(0, 76, 255, 0.227);
+            /* float: right; */
+            /* float: left; */
+        }
+        .d3{
+            background-color: rgb(219, 167, 167);
+            /* float: right; */
+            /* float: left; */
+        }
+    </style>
+</head>
+<body>
+    
+    <div class="outerDiv">
+        <div class="innerDiv d1">框1</div>
+        <div class="innerDiv d2">框2</div>
+        <div class="innerDiv d3">框3</div>
+    </div>
+</body>
+</html>

+ 48 - 0
web-demo/learn-css/06-positon.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        .innerDiv{
+            width: 100px;
+            height: 100px;
+        }
+        .d1{
+            background-color: rgb(235, 159, 159);
+            /* position: static; */
+            /* top left right bottom */
+
+            /* position: absolute;
+            left: 300px;
+            top: 100px; */
+
+            /* position: relative;
+            left: 30px;
+            top: 30px; */
+
+            position: fixed;
+            right: 30px;
+            top: 30px;
+        }
+        .d2{
+            background-color: rgb(231, 146, 44);
+        }
+        .d3{
+            background-color: rgb(180, 180, 235);
+        }
+    </style>
+</head>
+<body>
+    <!-- css定位 -->
+    <!-- 不设置定位的值时 是静态定位 static -->
+    <!-- 静态定位 就是没有定位 元素出现在该出现的位置  块级元素垂直排列 行内元素水平排列-->
+    <!-- 绝对定位 absolute 元素在页面上固定位置 此时会让出原来的位置 其他元素可以占用-->
+    <!-- 相对定位 relative 相对于原来的位置定位 定位后保留原来位置 其他元素不占用 -->
+    <!-- 固定定位 fixed 不会随着页面的上下移动而移动。此时会让出原来的位置 -->
+    <div class="innerDiv d1">框1</div>
+    <div class="innerDiv d2">框2</div>
+    <div class="innerDiv d3">框3</div>
+</body>
+</html>

+ 51 - 0
web-demo/learn-css/07-box.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        .outerDiv{
+            width: 800px;
+            height: 400px;
+            border: 1px solid rgb(76, 3, 3);
+            background-color: gainsboro;
+            margin: 0px auto;
+            /* 对于居中的处理 设置上下外边距为0 左右外边距自动居中 */
+        }
+        .innerDiv{
+            width: 100px;
+            height: 100px;
+            /* margin-top: 10px;
+            margin-bottom: 20px;
+            margin-left: 40px;
+            margin-right: 30px; */
+            margin: 10px 30px 20px 40px;
+            /* 可以传入两个值 第一个值对应上下 第二个值对应左右 */
+            /* 可以传入四个值 按照顺时针的顺序 分别对应 上右下左 */
+        }
+        .d1{
+            background-color: rgb(235, 159, 159);
+            /* padding-top: 10px;
+            padding-left: 20px;
+            padding-bottom: 30px;
+            padding-right: 40px; */
+            padding: 10px 40px 30px 20px; 
+        }
+        .d2{
+            background-color: rgb(231, 146, 44);
+        }
+        .d3{
+            background-color: rgb(180, 180, 235);
+        }
+    </style>
+</head>
+<body>
+    <div class="outerDiv">
+        <div class="innerDiv d1">框1</div>
+        <div class="innerDiv d2">框2</div>
+        <div class="innerDiv d3">框3</div>
+    </div>
+    
+</body>
+</html>

+ 9 - 0
web-demo/learn-css/css/button.css

@@ -0,0 +1,9 @@
+input {
+    width: 60px;
+    height: 40px;
+    background-color: bisque;
+    border: 1px solid yellowgreen;
+    font-size: 22px;
+    font-family: '隶书';
+    border-radius: 5px;
+}

+ 22 - 0
web-demo/learn-html/01-h.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- !+回车 可以快速创建页面结构 -->
+    <!-- ctrl + / 是注释的快捷键 -->
+    <!-- ctrl + D 复制当前行 -->
+    <h1>一级标题</h1>
+    <h2>二级标题</h2>
+    <h3>三级标题</h3>
+    <h4>四级标题</h4>
+    <h5>五级标题</h5>
+    <h6>六级标题</h6>
+    <!-- 假设给一个不存在的标签 会出现什么 -->
+    <!-- 标签不会显示 只是无法识别 此时按照正文的格式显示 -->
+    <h7>伪七级标题</h7>
+</body>
+</html>

+ 15 - 0
web-demo/learn-html/02-p.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- 代码中的回车在页面中是无法显示的 -->
+    123
+    456
+    <p>123</p>
+    <p>456</p>
+</body>
+</html>

+ 25 - 0
web-demo/learn-html/03-ol.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <ol>
+        <li>产品经理/需求分析</li>
+        <li>UI/UE</li>
+        <li>前端</li>
+        <li>鸿蒙</li>
+        <li>Java</li>
+        <li>C++</li>
+        <li>Python</li>
+        <li>Go</li>
+        <li>算法</li>
+        <li>嵌入式</li>
+        <li>测试</li>
+        <li>运维</li>
+        <li>网络安全</li>
+    </ol>
+</body>
+</html>

+ 37 - 0
web-demo/learn-html/04-ul.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <ul>
+        <li>
+            JavaEE
+            <ul>
+                <li>Html</li>
+                <li>Css</li>
+                <li>Javascript</li>
+                <li>Tomcat</li>
+                <li>Servlet</li>
+                <li>Demo</li>
+            </ul>
+        </li>
+        <li>Mybatis</li>
+        <li>
+            Spring
+            <ol>
+                <li>IOC</li>
+                <li>AOP</li>
+            </ol>
+        </li>
+        <li>SpringMVC</li>
+        <li>SpringBoot</li>
+        <li>Linux</li>
+        <li>Redis</li>
+        <li>SpringCloud</li>
+        <li>MQ</li>
+    </ul>
+</body>
+</html>

+ 37 - 0
web-demo/learn-html/05-a.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- 
+        a标签可以进行链接的跳转 
+          属性 href 用来定义链接
+                可以使用相对路径
+          属性 target 用来定义打开的方式
+                _blank 是在新窗口中打开
+    -->
+    <!-- 直接找到同级路径下的页面 此时默认使用的是 ./ -->
+    <a href="hello.html" target="_blank"> 使用blank跳转hello </a>
+    <!-- 换行是br 可以没有/ -->
+    <br />
+    <a href="hello.html" target="_self"> 使用self跳转hello </a>
+    <br />
+    <a href="hello.html"> 默认跳转到hello </a> <!-- 默认就是在自身窗口中打开 -->
+    <br />
+
+    <!-- 指定url地址 -->
+    <a href="https://www.koobietech.com/#/" target="_blank">四福科技</a>
+    <br />
+    <!-- 找其他路径下的页面 先找到当前路径 然后再找到对应的地址-->
+    <a href="./base/test.html" target="_blank">test.html</a>
+    <br />
+    <!-- 如果需要先找到上一个层级 使用 ../ -->
+
+    <!-- 绝对路径 从当前位置开始找其他位置 是相对路径 否则以/开头 代表绝对路径 -->
+    <a href="/base/test.html" target="_blank">绝对路径下的base test</a>
+
+</body>
+</html>

+ 21 - 0
web-demo/learn-html/06-img.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- 
+        img是单标签 
+           属性src source 图片的来源
+           属性title 是鼠标悬停时显示的文字
+           属性alt 是图片加载失败时显示的提示文字
+     -->
+    <img src="img/java.jpg" title="java" alt="java加载失败"/>
+    <img src="img/java1.jpg" title="java" alt="java加载失败"/>
+
+    <br />
+    <img src="https://tse2-mm.cn.bing.net/th/id/OIP-C.hmdakqRFQkIsSoK4L_3-gwHaDt?w=281&h=175&c=7&r=0&o=5&dpr=1.3&pid=1.7"/>
+</body>
+</html>

+ 18 - 0
web-demo/learn-html/07-audio.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- 
+        audio是音频加载的标签 
+            属性src 资源路径
+            属性autoplay 是否自动播放
+            属性controls 是否展示控制面板
+            属性loop 是否循环播放
+    -->
+    <audio src="img/music.mp3" autoplay="autoplay" controls="controls" loop="loop"/>
+</body>
+</html>

+ 19 - 0
web-demo/learn-html/08-video.html

@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- 
+        video是视频加载的标签 
+            属性src 资源路径
+            属性autoplay 是否自动播放
+            属性controls 是否展示控制面板
+            属性loop 是否循环播放
+            属性width 宽度 使用像素px作为单位
+    -->
+    <video src="img/movie.mp4" autoplay="autoplay" controls="controls" loop="loop" width="800px"/>
+</body>
+</html>

+ 66 - 0
web-demo/learn-html/09-table.html

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+    <!--
+        table标签 代表表格
+            thead 表头
+            tbody 表体
+            tfoot 表尾
+        tr 表示一行
+          td 表示行内的一个单元格
+          th 一种带有加粗和居中效果的td       
+     -->
+    <h3>成绩排名表</h3>
+    <!-- 可以通过border设置边框 -->
+    <table border="1px">
+        <thead>
+            <tr>
+                <th>排名</th>
+                <th>姓名</th>
+                <th>分数</th>
+                <th>说明</th>
+            </tr>
+        </thead>
+        <tbody>
+            <tr>
+                <td>1</td>
+                <td>张三</td>
+                <td>100</td>
+                <!-- 可以使用rowspan将多行合并到一起 -->
+                <td rowspan="5">前三名有奖学金</td>
+            </tr>
+            <tr>
+                <td>2</td>
+                <td>李四</td>
+                <td>99</td>
+                <!-- <td>前三名有奖学金</td> -->
+            </tr>
+            <tr>
+                <td>3</td>
+                <td>王五</td>
+                <td>98</td>
+                <!-- <td>前三名有奖学金</td> -->
+            </tr>
+            <tr>
+                <td>最高分</td>
+                <!-- 使用colspan将多列合并到一起 值对应要合并的列数 -->
+                <td colspan="2">100</td>
+                <!-- <td>100</td> -->
+            </tr>
+            <tr>
+                <td>平均分</td>
+                <td colspan="2">99</td>
+                <!-- <td>99</td> -->
+            </tr>
+        </tbody>
+    </table>
+</body>
+
+</html>

+ 64 - 0
web-demo/learn-html/10-form.html

@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+
+    <!-- 
+        表单的重要功能是 要将用户输入的信息提交到服务端 
+        form 
+            属性action 用于定义要提交信息的地址
+            属性method 对于http请求而言 最常见的请求方式 GET和POST
+    -->
+    <form action="hello.html" method="get">
+        <!-- 盛放请求所需要的信息/参数 -->
+        <!-- 使用input表示输入框 type代表类型 如果是text 代表文本输入框 -->
+        <!-- 使用name属性 声明输入框的名字 用户名一般使用username -->
+        用户名 <input type="text" name="username" /> <br />
+        <!-- 如果input type类型是password 代表密文输入框 输入时会自动显示* -->
+        密码 <input type="password" name="password" /> <br />
+
+        <!-- radio代表单选框类型 -->
+        <!-- 如果希望某一项默认被选中 那么增加属性 checked -->
+        <input type="radio" name="sex" value="1" /> 男
+        <input type="radio" name="sex" value="0" checked="checked"/> 女
+        <!-- 此时没有区分出要选择的数据 -->
+        <!-- http://127.0.0.1:5500/hello.html?username=12&password=12&sex=on -->
+        <!-- 如果设定了value值 那么可以传输出去 -->
+        <!-- http://127.0.0.1:5500/hello.html?username=12&password=12&sex=1 -->
+        <br />
+        <br />
+
+        <!-- checkbox代表复选框类型 -->
+        <!-- 当属性名和属性值相同时 可以简写 -->
+        <input type="checkbox" name="city" value="Beijing" checked/> 北京 
+        <input type="checkbox" name="city" value="Harbin" checked="checked"/> 哈尔滨 
+        <input type="checkbox" name="city" value="Shanghai"/> 上海 
+        <input type="checkbox" name="city" value="Guangzhou"/> 广州 
+        <input type="checkbox" name="city" value="Shenzhen"/> 深圳 
+        <br />
+        <br />
+
+        喜欢的运动是
+        <!-- 下拉框 select -->
+        <select name="interest">
+            <option value="running">跑步</option>
+            <option value="swimming">游泳</option>
+            <option value="shooting">射击</option>
+            <option value="null" selected="selected">--请选择--</option>
+        </select>
+
+        <br />
+        <br />
+        <input type="submit" value="登录" />
+        <input type="reset" value="重置" />
+
+    </form>
+</body>
+
+</html>

+ 50 - 0
web-demo/learn-html/11-form-1.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    
+    <form action="hello.html" method="get">
+        手机号 <input type="text" name="mobile"/> 
+        <br/>
+        <!-- 如果希望提交一些信息 但是不显示在页面中 -->
+        <input type="hidden" name="id" value="1111"/>
+        <!-- 在提交数据时 可以将隐藏域中的name和value拼接到url中 -->
+        <!-- http://127.0.0.1:5500/hello.html?mobile=123&id=1111 -->
+
+        <!-- 如果希望显示数据 但是用户不允许修改 可以增加属性readonly -->
+        <input type="text" name="tid" value="2222" readonly/>
+        <br/>
+        <!-- 此时的数据会被提交 -->
+        <!-- http://127.0.0.1:5500/hello.html?mobile=12&id=1111&tid=2222&desc=232 -->
+
+        <!-- 如果希望显示数据 也不允许修改 但也不希望提交 disabled 意思是不可用的-->
+        <input type="text" name="did" value="3333" disabled/>
+        <br/>
+        <!-- 此时的did不在提交的url参数中 -->
+        <!-- http://127.0.0.1:5500/hello.html?mobile=12&id=1111&tid=2222&desc=12 -->
+
+        <br/>
+        <!-- 多行文本框 对应标签textarea -->
+        备注 <textarea name="desc"></textarea>
+    
+        <br/>
+
+        <!-- 文件标签 -->
+        头像 <input type="file" name="file" /> 
+        <br/>
+        <button type="submit">提交button</button>
+        <input type="submit" value="提交" />
+        <br />
+        <button type="reset">重置button</button>
+        <input type="reset" value="重置" />
+        <br />
+        <!-- 对于普通类型的按钮 点击后无效果 要结合javascript绑定单击函数 -->
+        <button type="button">普通button</button>
+        <input type="button" value="普通" />
+    </form>
+</body>
+</html>

+ 29 - 0
web-demo/learn-html/12-div.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- style是设置标签对应范围及其风格 -->
+    <!-- border边框距离 1px是1像素  solid代表实线 red是实线的颜色-->
+    <!-- width是宽 height是高 -->
+    <!-- background-color是背景颜色 -->
+    <div style="border: 1px solid rgb(255, 85, 0); width: 500px; height: 400px; background-color: rgb(255, 80, 0);">
+        <!-- 块之间是可以嵌套的-->
+        <div style="border:1px solid gray;width: 400px;height: 100px; background-color: aqua;">
+            <!-- span是对于局部数据的特殊处理 -->
+             <!-- font-size 是设置字体大小 -->
+             <!-- font-weight 是设置字体宽度 -->
+            <p> <span style="font-size: 30px; font-weight: bold;">2024</span>年10月13日</p>
+            <p>456</p>
+            <!-- <p>456</p>
+            <p>456</p> -->
+        </div>
+        <div style="border:1px solid yellow;width: 400px;height: 100px; background-color: greenyellow;">
+            
+        </div>
+    </div>
+</body>
+</html>

+ 16 - 0
web-demo/learn-html/13-special.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+    <!-- 如果就想让页面显示出 <h1> -->
+    &lt;h1&gt;
+    <!--小于号对应 &lt 小于号对应 &gt  -->
+</body>
+
+</html>

+ 11 - 0
web-demo/learn-html/base/test.html

@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    TEST 
+</body>
+</html>

+ 15 - 0
web-demo/learn-html/base1/test1.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- 如果要找到上一个层级中的其他路径 -->
+    <a href="../base/test.html" target="_blank">base下的test</a>
+    <br/>
+    <!-- 使用绝对路径 可以确保在当前项目的根路径下查找 在当前项目的任何页面中都可以使用相同的绝对路径 -->
+    <a href="/base/test.html" target="_blank">绝对路径下的base test</a>
+</body>
+</html>

+ 24 - 0
web-demo/learn-html/day02/01-ref.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+
+    <p>WWF 的目标是:<q>构建人与自然和谐共存的世界。</q></p>
+
+    <p>以下内容引用自 WWF 的网站:</p>
+    <blockquote cite="http://www.worldwildlife.org/who/index.html">
+        五十年来,WWF 一直致力于保护自然界的未来。
+        世界领先的环保组织,WWF 工作于 100 个国家,
+        并得到美国一百二十万会员及全球近五百万会员的支持。
+    </blockquote>
+
+    <p><abbr title="World Health Organization">WHO</abbr> 成立于 1948 年。</p>
+</body>
+
+</html>

+ 21 - 0
web-demo/learn-html/day02/02-color.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+
+    <!-- style是设置标签对应范围及其风格 -->
+    <!-- border边框距离 1px是1像素  solid代表实线 red是实线的颜色-->
+    <!-- width是宽 height是高 -->
+    <!-- background-color是背景颜色 -->
+    <div style="border: 1px solid rgb(255, 85, 0); width: 500px; height: 400px; background-color: rgb(255, 80, 0);">
+    </div>
+
+</body>
+
+</html>

+ 87 - 0
web-demo/learn-html/day02/03-table.html

@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+    <table border="6" width="500px">
+        <!-- 标题的宽度是以表格的宽度为主 超出部分默认换行 -->
+        <caption>我的标题题题题题题题题题题题题题题题题题题题题题题题</caption>
+        <tr>
+            <td>100</td>
+            <td>200</td>
+            <td>300</td>
+        </tr>
+        <tr>
+            <td>400</td>
+            <td>500</td>
+            <td>600</td>
+        </tr>
+    </table>
+
+    <h4>背景颜色:</h4>
+    <!-- 这里的bgcolor使用的是颜色名 或者 十六进制 -->
+    <table border="1" bgcolor="#ff5000">
+        <tr>
+            <td>First</td>
+            <td>Row</td>
+        </tr>
+        <tr>
+            <td>Second</td>
+            <td>Row</td>
+        </tr>
+    </table>
+
+    <br />
+
+    <table width="400" border="1" align="left">
+        <thead align="right">
+            <tr>
+                <!-- 
+                    <th align="left">消费项目....</th>
+                    <th align="center">一月</th>
+                    <th align="right">二月</th> 
+                -->
+                <th>消费项目....</th>
+                <th>一月</th>
+                <th>二月</th>
+            </tr>
+        </thead>
+        <tbody align="left">
+            <tr>
+                <td>衣服</td>
+                <td>$241.10</td>
+                <td>$50.20</td>
+            </tr>
+            <!-- 
+                <tr>
+                <td align="left">衣服</td>
+                <td align="right">$241.10</td>
+                <td align="right">$50.20</td>
+                </tr>
+                <tr>
+                <td align="left">化妆品</td>
+                <td align="right">$30.00</td>
+                <td align="right">$44.45</td>
+                </tr>
+                <tr>
+                <td align="left">食物</td>
+                <td align="right">$730.40</td>
+                <td align="right">$650.00</td>
+                </tr>
+                <tr>
+                <th align="left">总计</th>
+                <th align="right">$1001.50</th>
+                <th align="right">$744.65</th>
+                </tr> 
+            -->
+        </tbody>
+    </table>
+
+</body>
+
+</html>

+ 34 - 0
web-demo/learn-html/hello.html

@@ -0,0 +1,34 @@
+<!-- 文档声明 -->
+<!DOCTYPE html>
+<!-- 
+   专业词汇
+   标签 是一对尖括号所组成的 可能成对出现 叫双标签 可能单个出现 叫单标签
+   属性 是对标签特征进行设置的一种方式 一般在开始标签中定义
+   文本 是双标签中的文字
+   元素 是开始标签 + 属性 + 文本 + 结束标签 称之为一个元素
+        是单标签 + 属性 也称之为一个元素
+  -->
+<!-- html是根标签 -->
+<html>
+<!-- head头部 存放不显示在页面中但也很重要的内容 -->
+<head>
+	<!-- 可以定义网页的字符集 也可以定义网页的标题-->
+	<title>这是标题</title>
+	<meta charset='utf-8'/>  <!-- 属性的值 可以使用双引号也可以使用单引号 -->
+</head>
+<!-- body主体部分 存放显示在页面中的内容 -->
+<BODY>
+	Hello World !!!
+	<h1>一级标题</h1>
+	<!-- 不严格区分大小写 但大小写不能混用 建议使用小写 -->
+	<input type="text"/> 
+
+	<!-- 
+		标签是可以嵌套的 但不可以交叉
+		big 代表放大
+		i 代表倾斜
+	-->
+	<i><big>放大的文字</big></i>
+	<!-- <i><big>放大的文字</i></big>  -->
+</BODY>	
+</html>

+ 1 - 0
web-demo/learn-html/hello1.html

@@ -0,0 +1 @@
+Hello World 111

BIN
web-demo/learn-html/img/java.jpg


BIN
web-demo/learn-html/img/movie.mp4


BIN
web-demo/learn-html/img/music.mp3


+ 14 - 0
web-demo/learn-js/01-dom.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>标题</title>
+</head>
+<body>
+    <div>
+        <div>框1</div>
+        <div>框2</div>
+        <div>框3</div>
+    </div>
+</body>
+</html>

+ 21 - 0
web-demo/learn-js/02-script.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+
+    <!-- 写一段js代码 -->
+    <script>
+        // 一段逻辑
+        function surprise(){
+            alert("hello 我是惊喜!")
+        }
+    </script>
+</head>
+<body>
+    <!-- onclick是点击按钮触发的事件 -->
+    <button onclick="surprise()">点我点我点我</button>
+    
+</body>
+</html>

+ 13 - 0
web-demo/learn-js/03-outside.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+
+    <script src="js/button.js" type="text/javascript"></script>
+</head>
+<body>
+    <button onclick="surprise()">点我</button>
+</body>
+</html>

+ 65 - 0
web-demo/learn-js/04-if.html

@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+
+    <!-- 写一段js代码 -->
+    <script>
+        // 一段逻辑
+        function surprise(){
+            // alert("hello 我是惊喜!")
+            
+            // 非零数字 判断为true
+            // if(0){
+            //     console.log(true)
+            // }else{
+            //     console.log(false)
+            // }
+
+            // // 非空字符串 判断为true
+            // if('false'){
+            //     console.log(true)
+            // }else{
+            //     console.log(false)
+            // }
+
+            // var monthStr = prompt("请输入月份:")
+            // var month = Number.parseInt(monthStr)
+            // switch(month){
+            //     case 3:
+            //     case 4:
+            //     case 5:   
+            //        console.log("春天")
+            //        break
+            //     case 6:
+            //     case 7:
+            //     case 8:   
+            //        console.log("夏天")
+            //        break
+            //     default: 
+            //        console.log("不知道什么天")           
+            // }
+
+            // 九九乘法表
+            var i = 1
+            while(i <= 9){
+                var j = 1
+                while(j <= i){
+                    document.write(j + "*" + i + "=" + i*j + "&nbsp;&nbsp;&nbsp;")
+                    j++
+                }
+                document.write("<br>")
+                i++
+            }
+
+        }
+    </script>
+</head>
+<body>
+    <!-- onclick是点击按钮触发的事件 -->
+    <button onclick="surprise()">点我点我点我</button>
+    
+</body>
+</html>

+ 58 - 0
web-demo/learn-js/05-data.html

@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+
+    <script>
+        /* JS是弱类型的 声明变量时 var */
+        var i = 10
+        // 打印数据到浏览器控制台
+        console.log(i)
+        // typeof 判断数据的类型
+        console.log(typeof i)
+
+        // 当给变量赋值为其他类型 是允许的
+        i = "abc"
+        console.log(i)
+        console.log(typeof i)
+
+        // 可以声明同名的变量
+        var i = 1>10
+        console.log(i)
+        console.log(typeof i)
+
+        // 这里Object是大写
+        i = new Object()
+        console.log(i)
+        console.log(typeof i)
+
+        //声明函数
+        function fun1(){}
+        var fun2 = function(){}
+        console.log(fun1)
+        console.log(typeof fun1)
+        console.log(fun2)
+        console.log(typeof fun2)
+
+        // 声明一个变量 没有赋值 此时会打印什么
+        // 此时的值和类型都没有定义 所以打印undefined
+        var i1
+        console.log(i1)
+        console.log(typeof i1)
+
+        // 如果赋值为null  
+        // 那么值是null 类型是object 是空对象
+        i1 = null
+        console.log(i1)
+        console.log(typeof i1)
+        // Uncaught ReferenceError: i2 is not defined
+        // console.log(i2)  // 如果变量名都没有定义 会报错
+
+    </script>
+</head>
+<body>
+    Hi Data
+</body>
+</html>

+ 105 - 0
web-demo/learn-js/06-opera.html

@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        console.log(10+2)
+        console.log(10-2)
+        console.log(10*2)
+        console.log(10/2)  // 5
+        console.log(10/4)  // 2? 2.5
+        console.log(10%2)
+
+        console.log(10/0)  // 除0 Infinity
+        console.log(10%0)  // 模0 NaN = not a number
+
+        var i = 10
+        console.log(i++)  // 10  i=11
+        console.log(i--)  // 11  i=10
+        console.log(i += 1) // 11 i=10+1
+        console.log(i -= 1)
+        console.log(i *= 1)
+        console.log(i /= 1)
+        console.log(i /= 0)
+        console.log(i %= 0)
+
+        console.log(10 > 20)
+        console.log(10 >= 20)
+        console.log(10 < 20)
+        console.log(10 <= 20)
+        console.log(10 != 20)
+        console.log(10 == 20)
+        // true or false
+        // == 等值符  如果两端的数据类型不一致 会转换为number再比较
+        console.log(1 == '1')
+        console.log(1 == true)
+        console.log(123 == '123')
+        console.log(0 == false)
+        // === 等同符  如果数据类型不一致 返回false 如果类型一致 再去比较值
+        console.log(1 === '1')
+        console.log(1 === true)
+        console.log(1 === 1)
+
+
+        console.log(10.5 % 3)  //1? 1.5 √
+        var r = 123.456
+        var s = 3.14 * r * r
+        console.log(s)  // 小数位有几位  47857.94555904001
+        // 如果要表示Number中的最大整数 和 最小整数
+        console.log(Number.MAX_SAFE_INTEGER)  // 9007199254740991
+        console.log(Number.MIN_SAFE_INTEGER)  // -9007199254740991
+
+        var str = "abc"
+        var str1 = 'abc'
+        // 可以使用双引号嵌套单引号 反之亦然 但单引号不能互相嵌套
+        var str2 = "ab'c'"
+        var str3 = 'a"bc"bc'
+        console.log(str2)
+        console.log(str3)
+
+        var b1 = true
+        var b2 = false
+        console.log(b1)
+        console.log(b2)
+
+        console.log(true && true)
+        console.log(true && false)
+        console.log(true || false)
+        console.log(false || false)
+        console.log(!true)
+        console.log(!(2>5))
+    
+        console.log(false == 0)
+        console.log(false === 0)
+        console.log(NaN === NaN)  // true or false
+        console.log(isNaN(NaN))
+        console.log(isNaN(10%0))
+        // 处理浮点数时  有精度丢失的问题
+        console.log(1/3 === (1 - 2/3))  // true or false
+        console.log(Math.abs(1/3 === (1 - 2/3)) < 0.0000001) 
+
+        // 1111|1111|1111|1111|0000
+        // 在java中 这是long类型
+        console.log(11111111111111111111)
+        // BigInt是内置的类型 表示方法是在整数后面加n
+        var l = BigInt(11111111111111111111)
+        console.log(l)
+        console.log(typeof l)
+
+        console.log(123456n + 3456789n)
+        console.log(123456n - 3456789n)
+        console.log(123456n * 3456789n)
+        console.log(123456n / 3456789n)
+        // 不能把BigInt和Number一起运算
+        // 06-opera.html:95  Uncaught TypeError: Cannot mix BigInt and other types, use explicit conversions
+        console.log(123456n + 3456789)
+
+
+    </script>
+</head>
+<body>
+    
+</body>
+</html>

+ 106 - 0
web-demo/learn-js/07-arr.html

@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // 数组在js中不是大括号 而是中括号
+        var arr = [1, 2, 3]
+        console.log(arr[0])
+        console.log(arr[1])
+        console.log(arr[2])
+        console.log(arr[3])  // 报错还是其他  这里是undefined
+
+        // 这里并不要求是相同的数据类型
+        var arr1 = new Array(3, 4, 5.12, 'abc', true, null)
+        console.log(arr1)
+        console.log(arr1.length)
+        // 可以调整数组大小  如果新的长度大于原长度 会补空 如果小于原长度 会截取
+        arr1.length = 2
+        console.log(arr1) 
+        arr1.length = 6
+        console.log(arr1) 
+
+        var arr2 = ['A','B','C']
+        arr2[1] = 99
+        console.log(arr2)
+        arr2[4] = 97
+        // 索引超出范围时  数组大小会自动调整  空的位置使用undefined
+        console.log(arr2) //A 99 C undefined 97
+        console.log(typeof arr2[3])
+
+        var arr3 = [10,20,'30','xyz']
+        // 查找元素在数组中的索引位置
+        console.log(arr3.indexOf(20)) // 1
+        console.log(arr3.indexOf(30)) // -1
+
+
+        console.log(arr3)
+        // 和java中的subString()是类似的
+        console.log(arr3.slice(3))
+        console.log(arr3.slice(0,3))
+        // 如果没有传参数 会从头到尾截取 相当于复制数组
+        console.log(arr3.slice())
+
+        // 如果往数组中添加元素 可以用push 会添加到末尾 同时可以push多个
+        arr3.push(40)
+        console.log(arr3)
+        arr3.push(50,60)
+        console.log(arr3)
+
+        // 取数据 10 or 60
+        // 从尾部取 可以达到栈的效果  先进后出 后进先出
+        arr3.pop()
+        console.log(arr3)
+        var arr4 = [1]
+        console.log(arr4.pop())
+        console.log(arr4.pop())  // 会报错吗 undefined
+
+        // 如果要从数组头部添加元素
+        arr4.unshift(10,20)
+        console.log(arr4)
+        arr4.unshift(30)
+        console.log(arr4)
+        // 如果从数组头部 删除元素
+        console.log(arr4.shift())
+        console.log(arr4)
+        console.log(arr4.shift())
+        console.log(arr4.shift())
+        console.log(arr4.shift())  // undefined
+
+        // var arr5 = [12,68,5,10,89]
+        // [10,12,5,68,89]
+        var arr5 = ['B','C','A']
+        console.log(arr5.sort())
+
+        // concat可以把两个数组连接起来  返回一个新的数组
+        var arr6 = arr5.concat([1,2,3])
+        console.log(arr6)
+
+        // 将数组中的每个元素用指定的字符串联起来 返回连接后的字符串
+        console.log(arr6.join('-')) // A-B-C-1-2-3
+        // 翻转数组
+        arr6.reverse()
+        console.log(arr6)
+        // 从索引2开始 删除3个元素 
+        arr6.splice(2,3)
+        console.log(arr6)
+        // 可以在删除的同时 进行添加
+        arr6.splice(2,1,'D','E')
+        console.log(arr6)
+
+        var arr7 = [[1,2,3],[4,5,6]]
+        console.log(arr7)
+
+
+
+    </script>
+</head>
+
+<body>
+    Hi Array
+</body>
+
+</html>

+ 87 - 0
web-demo/learn-js/08-obj.html

@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // 使用new Object() 创建对象
+        var person = new Object()
+        // 创建对象后 可以直接设置属性 并赋值
+        person.name = "zhangsan"
+        person.age = 18
+        person.interests = ["篮球", "足球", "乒乓球"]
+        // 方法也是对象的属性之一
+        // 在方法中 调用属性 也使用this
+        person.info = function () {
+            console.log(this.name + "的年龄" + this.age + ",喜欢的运动有:")
+            // 对数组元素的遍历
+            for (var i = 0; i < this.interests.length; i++) {
+                console.log(this.interests[i])
+            }
+        }
+
+        // console.log(person.name)
+        // console.log(person.age)
+        // console.log(person.interests)
+        person.info()
+
+        // 使用{}创建对象
+        var person = {
+            // 格式: 属性名:属性值, 属性名:属性值
+            "name": "张三",
+            "age": 20,
+            "interests": ["篮球", "足球", "乒乓球"],
+            "info": function(){
+                console.log(this.name + "的年龄" + this.age + ",喜欢的运动有:")
+                // 对数组元素的遍历
+                for (var i = 0; i < this.interests.length; i++) {
+                    console.log(this.interests[i])
+                }
+            }
+        }
+        person.info()
+        console.log(person.name)
+        console.log(person.age)
+        console.log(person)
+
+        
+        var person = {
+            "name": "李四"
+        }
+        person.age  // 
+        console.log(person.age)  // undefined
+        // 新增属性
+        person.age = 18
+        console.log(person)
+        // 删除属性
+        delete person.age
+        console.log(person)
+        delete person['name']
+        console.log(person)
+        delete person.interests  // 删除不存在的属性时 不会报错
+        console.log(person)
+
+        // 可以通过in判断属性是否在对象中存在
+        // 要注意的是 in可能通过继承得到
+        var person = {
+            "name": "王五"
+        }
+        console.log("name" in person)
+        console.log("age" in person)
+        // toString 在Object里被定义
+        console.log("toString" in person)  // true
+        // 判断一个属性是否是自身拥有的 而不是继承得到的
+        console.log(person.hasOwnProperty("name"))
+        console.log(person.hasOwnProperty("toString"))
+
+    </script>
+</head>
+
+<body>
+    Hi Object
+
+</body>
+
+</html>

+ 58 - 0
web-demo/learn-js/09-for.html

@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        var arr = ["apple", "orange", "banana"]
+        for (var i = 0; i < arr.length; i++) {
+            console.log(arr[i])
+        }
+        // Array也可以看做是对象
+        // 此时元素的索引被看做是对象的属性
+        for(var i in arr){
+            console.log(i)
+            console.log(arr[i])  
+        }
+        // 和java中的增强for循环 有较大不同
+
+        var person = {
+            // 格式: 属性名:属性值, 属性名:属性值
+            "name": "张三",
+            "age": 20,
+            "interests": ["篮球", "足球", "乒乓球"],
+            "info": function(){
+                console.log(this.name + "的年龄" + this.age + ",喜欢的运动有:")
+                // 对数组元素的遍历
+                for (var i = 0; i < this.interests.length; i++) {
+                    console.log(this.interests[i])
+                }
+            }
+        }
+        // 对象其实是一种key value的形式
+        for(var key in person){
+            console.log(key)
+        }
+        // 过滤掉继承获取的属性
+        for(var key in person){
+            if(person.hasOwnProperty(key)){
+                console.log(key)
+            }
+        }
+
+        // while
+        var n = 10
+        while(n > 0){
+            n = n - 2
+        }
+        console.log(n)
+    </script>
+</head>
+
+<body>
+    Hi For
+</body>
+
+</html>

+ 29 - 0
web-demo/learn-js/10-while.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // while
+        var n = 10
+        while (n > 0) {
+            n = n - 2
+        }
+        console.log(n)
+
+        // do while
+        var n = 10
+        do {
+            n = n - 2
+        } while (n > 0)
+        console.log(n)
+    </script>
+</head>
+
+<body>
+    hi while
+</body>
+
+</html>

+ 96 - 0
web-demo/learn-js/11-map.html

@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // 创建一个map类型的数据
+        // ["name","zhagnsan"]
+        var m = new Map([["zhangsan",18],["lisi",20],["wangwu",22]])
+        // 获取某一个key的值
+        console.log(m.get("zhangsan"))
+
+        // 创建一个空的map
+        var m = new Map()
+        // 赋值 key value
+        m.set("zhangsan",18)
+        // 判断key是否存在
+        console.log(m.has("zhangsan"))
+        console.log(m.has("lisi"))  
+        console.log(m)
+        // 删除key
+        // m.delete("zhangsan")
+        // // 获取一个不存在的key
+        // console.log(m.get("zhangsan"))  //undefined
+
+        // Set
+        var s = new Set()
+        var s1 = new Set([1,2,3])
+        console.log(s)
+        console.log(s1)
+
+        var s2 = new Set([1,2,3,3,'3'])
+        console.log(s2)
+        s2.add(4)
+        console.log(s2)
+        s2.delete(3)
+        console.log(s2)
+
+        // 迭代器
+        var arr = [1,2,3]
+        // ES6的新语法
+        for(var i of arr){
+            // 这里获取的是数组元素的值
+            console.log(i)
+        }
+
+        for(var x of m){
+            console.log(x)
+        }
+
+        for(var x of s1){
+            console.log(x)
+        }
+
+        console.log("----------------")
+        var arr1 = ['A','B','C']
+        arr1.name = 'H'
+        // 如果使用in 可能遍历出不一样的结果
+        for(var i1 in arr1){
+            console.log(i1)
+        }
+        // 此时用of遍历 会更加安全
+        console.log("----------------")
+        for(var i of arr1){
+            console.log(i)
+        }
+
+        // 最好的方式 是使用内置的forEach
+        // 会接收一个函数 每次迭代会自动回调此函数
+        arr1.forEach(function(element,index,array){
+            // element指当前元素的值 index指当前索引 array指数组对象本身
+            console.log(`element=${element},index= ${index}`)  // 模版字符串  反引号 1左边的位置~打出来的
+        })
+        m.forEach(function(value,key,map){
+            // 回调参数依次为 value值 key map本身
+            console.log(`value=${value},key=${key}`)
+        })
+        s1.forEach(function(element,sameElement,set){
+            // 回调函数 前两个参数都是元素本身 最后一个是set本身
+            console.log(`element=${element}`)
+        })
+
+        // 可以简写
+        // JS的函数调用 不要求参数必须一致
+        arr1.forEach(function(element){
+            // element指当前元素的值 index指当前索引 array指数组对象本身
+            console.log(`element=${element}`)  // 模版字符串  反引号 1左边的位置~打出来的
+        })
+
+    </script>
+</head>
+<body>
+    Hi Map
+</body>
+</html>

+ 36 - 0
web-demo/learn-js/12-json.html

@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // 使用一串字符串来描述对象
+        var personStr = '{"name":"张三","age":20,"interests":["篮球","足球","乒乓球"]}'
+        console.log(personStr)
+        console.log(typeof personStr)
+        // 把对象和字符串之间互相转换
+        var person = JSON.parse(personStr)
+        console.log(person)
+
+        var person1 = {
+            // 格式: 属性名:属性值, 属性名:属性值
+            "name": "张三",
+            "age": 20,
+            "interests": ["篮球", "足球", "乒乓球"],
+            "info": function(){
+                console.log(this.name + "的年龄" + this.age + ",喜欢的运动有:")
+                // 对数组元素的遍历
+                for (var i = 0; i < this.interests.length; i++) {
+                    console.log(this.interests[i])
+                }
+            }
+        }
+        var personStr1 = JSON.stringify(person1)
+        console.log(personStr1)
+    </script>
+</head>
+<body>
+    Hi Json
+</body>
+</html>

+ 101 - 0
web-demo/learn-js/13-event.html

@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // 鼠标事件
+        function fun1() {
+            console.log("单击了")
+        }
+        function fun2() {
+            console.log("单击了2次")
+        }
+        function fun3() {
+            console.log("双击了")
+        }
+        function fun4() {
+            console.log("鼠标悬停了")
+        }
+        function fun5() {
+            console.log("鼠标移动了")
+        }
+        function fun6() {
+            console.log("鼠标离开了")
+        }
+
+        // 键盘事件
+        function fun7() {
+            console.log("键盘按下了")
+        }
+        function fun8() {
+            console.log("键盘抬起了")
+        }
+
+        // 表单事件
+        function func1() {
+            console.log("获得焦点了")
+        }
+        function func2() {
+            console.log("失去焦点了")
+        }
+        function func3(value) {
+            console.log("内容改变为:" + value)
+        }
+        function func4(value) {
+            console.log("选项改变为:" + value)
+        }
+        function func5() {
+            console.log("表单重置了")
+        }
+
+        function func6() {
+            alert("表单提交了")
+            /*
+            弹窗的三种方式
+             alert() 信息提示框
+             prompt() 信息输入框
+             confirm() 信息确认框
+            */
+            var flag = confirm("确定要提交表单吗")
+            if(!flag){
+                return false
+            }
+            return true
+        }
+    </script>
+</head>
+
+<body>
+    <!-- 
+        这里的点击操作 是一个事件(就是行为的发生,可能是用户的,可能是浏览器的) 
+        分为鼠标事件、键盘事件、表单事件等
+    -->
+    <input type="button" value="按钮" onclick="fun1(),fun2()" ondblclick="fun3()" />
+    <br />
+    <!-- onmouseover 鼠标在图片之上 悬停  onmousemove 鼠标在图片上移动  onmouseleave 鼠标离开的图片 -->
+    <img src="img/java.jpg" onmouseover="fun4()" onmousemove="fun5()" onmouseleave="fun6()" />
+    <br />
+
+    <input type="text" onkeydown="fun7()" onkeyup="fun8()" />
+    <br>
+    <br>
+    <!-- return 是将结果返回给浏览器 -->
+    <form action="01-dom.html" method="get" onreset="func5()" onsubmit="return func6()">
+        用户名:<input type="text" name="realname" onfocus="func1()" onblur="func2()" onchange="func3(this.value)" /> <br />
+        账户名:<input type="text" name="loginname" /> <br />
+        选择籍贯:
+        <select onchange="func4(this.value)">
+            <option value="1">北京</option>
+            <option value="2">上海</option>
+            <option value="3">哈尔滨</option>
+        </select>
+        <br/>
+        <input type="submit" value="提交" />
+        <input type="reset" value="清空" />
+    </form>
+</body>
+
+</html>

+ 56 - 0
web-demo/learn-js/14-event-dom.html

@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <script>
+        // 如果从body中搬到head中 因为代码的渲染是自上而下的 所以此时找不到btn元素 会报错
+        // 如果将代码直接写在script里 代码会直接执行
+        // 如果将代码写在函数里 代码会在函数被调用时执行
+        function ready(){
+
+            var d1 = document.getElementById("d1")
+            d1.onclick = function(){
+                // 修改元素样式中的属性值
+                d1.style.backgroundColor = "red"
+            }
+
+            var btn = document.getElementById("btn1")
+            // 绑定一个事件 并且编写触发逻辑
+            btn.onclick = function(){
+                alert("按钮单击了")
+                // 手动触发事件  通过dom编程触发事件
+                d1.onclick()
+            }
+        }
+        
+    </script>
+    <style>
+        .div1{
+            width: 100px;
+            height: 100px;
+            background-color: yellow;
+        }
+    </style>
+</head>
+<!-- 如果希望一部分代码在页面加载完成后 被调用 可以使用onload触发 -->
+<body onload="ready()">
+    
+    <button id="btn1">按钮</button>
+    <br />
+    <!-- <script>
+        // 使用dom获取要操作的元素
+        //   通过id名字来获取元素
+        var btn = document.getElementById("btn1")
+        // 绑定一个事件 并且编写触发逻辑
+        btn.onclick = function(){
+            alert("按钮单击了")
+        }
+    </script> -->
+
+    <div id="d1" class="div1">
+    </div>
+
+</body>
+</html>

BIN
web-demo/learn-js/img/java.jpg


+ 3 - 0
web-demo/learn-js/js/button.js

@@ -0,0 +1,3 @@
+function surprise(){
+    alert("hello 我是惊喜!")
+}

+ 38 - 0
xml-demo/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 8 - 0
xml-demo/.idea/.gitignore

@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 7 - 0
xml-demo/.idea/encodings.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 14 - 0
xml-demo/.idea/misc.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-17" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 124 - 0
xml-demo/.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 4 - 0
xml-demo/.idea/vcs.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings" defaultProject="true" />
+</project>

+ 31 - 0
xml-demo/pom.xml

@@ -0,0 +1,31 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.sf</groupId>
+  <artifactId>xml-demo</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>xml-demo</name>
+  <url>http://maven.apache.org</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <version>2.11.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>2.1.4</version>
+    </dependency>
+
+  </dependencies>
+</project>

+ 20 - 0
xml-demo/src/main/java/com/sf/App.java

@@ -0,0 +1,20 @@
+package com.sf;
+
+import com.google.gson.Gson;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+        // 从前端接收的是字符串
+        String str = "{\"username\":\"lanluo_bingzi@126.com\",\"password\":\"123456\"}";
+        LoginParam loginParam = new Gson().fromJson(str, LoginParam.class);
+        System.out.println(loginParam);
+        // 这个用户名和密码 是去数据库中查询的
+    }
+}

+ 35 - 0
xml-demo/src/main/java/com/sf/LoginParam.java

@@ -0,0 +1,35 @@
+package com.sf;
+
+public class LoginParam {
+    private String username;
+    private String password;
+
+    public LoginParam(String username, String password) {
+        this.username = username;
+        this.password = password;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    @Override
+    public String toString() {
+        return "LoginParam{" +
+                "username='" + username + '\'' +
+                ", password='" + password + '\'' +
+                '}';
+    }
+}

+ 26 - 0
xml-demo/src/main/java/com/sf/Solution_209.java

@@ -0,0 +1,26 @@
+package com.sf;
+
+public class Solution_209 {
+
+    public int minSubArrayLen(int target, int[] nums) {
+        // 记录子数组的左边界
+        int left = 0;
+        // 记录子数组的右边界
+        int right = 0;
+        int sum = 0;
+        // 这里要赋值为int的最大值
+        int min = Integer.MAX_VALUE;
+        for (; right < nums.length; right++) {
+            sum += nums[right];
+            // 判断是否满足条件
+            while (sum >= target) {
+                // 记录当前子数组的长度 是否是最小值
+                int size = right - left + 1;
+                min = Math.min(min, size);
+                sum -= nums[left];
+                left++;
+            }
+        }
+        return min == Integer.MAX_VALUE ? 0 : min;
+    }
+}

+ 34 - 0
xml-demo/src/main/java/com/sf/Solution_904.java

@@ -0,0 +1,34 @@
+package com.sf;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Solution_904 {
+
+    public int totalFruit(int[] fruits) {
+        int left = 0;
+        int right = 0;
+        // 能采摘的最多树的个数
+        int max = 0;
+        // 记录篮子采摘的类型 和 对应的数量
+        Map<Integer,Integer> map = new HashMap<>();
+        for (; right < fruits.length; right++) {
+            // 先放水果
+            int fruit = fruits[right];
+            // getOrDefault获取当前的key是否存储过 如果没有存储 返回0 如果存储 返回本身
+            map.put(fruit, map.getOrDefault(fruit,0) + 1);
+            while (map.size() > 2){
+                // 此时移动窗口
+                int leftFruit = fruits[left];
+                map.put(leftFruit, map.get(leftFruit) - 1);
+                // 如果移动的位置 map中存储的值为0 才移除干净
+                if(map.get(leftFruit) == 0){
+                    map.remove(leftFruit);
+                }
+                left++;
+            }
+            max = Math.max(max, right - left + 1);
+        }
+        return max;
+    }
+}

+ 71 - 0
xml-demo/src/main/java/com/sf/properties/Test.java

@@ -0,0 +1,71 @@
+package com.sf.properties;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
+
+public class Test {
+
+    public static void main(String[] args) throws Exception{
+//        read();
+//        read1();
+//        read2();
+        write();
+    }
+
+    public static void read() throws Exception{
+        //  Properties 本质上是map 继承自hashtable 是线程安全的hashmap
+        //  线程安全: 支持高并发场景的数据处理
+        //  通过相对位置来查找文件  从项目根路径开始
+        InputStream inputStream = new FileInputStream("src/main/resources/jdbc.properties");
+        Properties prop = new Properties();
+        // 将输入流 加载到properties对象中
+        prop.load(inputStream);
+
+        // 打印数据
+        prop.list(System.out);
+        String value = prop.getProperty("jdbc.url");
+        System.out.println(value);
+    }
+
+    public static void read1() throws Exception{
+        // ClassLoader是类加载器
+        // getSystemResourceAsStream 获取系统资源 可以直接找到resources目录下 参数是文件名称
+        InputStream inputStream = ClassLoader.getSystemResourceAsStream("jdbc.properties");
+        // 另一种加载输入流的数据
+        ResourceBundle resourceBundle = new PropertyResourceBundle(inputStream);
+        // 快捷方式 .var 接收方法的返回结果
+        // Enumeration 是所有key的枚举
+        Enumeration<String> keys = resourceBundle.getKeys();
+        // hasMoreElements 判断是否还有更多元素
+        while(keys.hasMoreElements()){
+            String key = keys.nextElement();
+            // 找到key对应的value值
+            System.out.println(key + "=" + resourceBundle.getString(key));
+        }
+    }
+
+    public static void read2() throws Exception{
+        // 可以直接帮你拼接文件的路径 及其后缀
+        ResourceBundle resourceBundle = ResourceBundle.getBundle("jdbc");
+        // keySet() 是获取所有key组成的set
+        for(String key : resourceBundle.keySet()){
+            System.out.println(key + "=" + resourceBundle.getString(key));
+        }
+    }
+
+    public static void write() throws Exception{
+        Properties properties = new Properties();
+        OutputStream outputStream = new FileOutputStream("src/main/resources/sth.properties");
+        // 设置key value
+        properties.setProperty("sth","123456");
+        // 第二个参数 是备注信息
+        properties.store(outputStream, "comments");
+        outputStream.close();
+    }
+}

+ 66 - 0
xml-demo/src/main/java/com/sf/xml/Test.java

@@ -0,0 +1,66 @@
+package com.sf.xml;
+
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
+
+// dom4j 官网 https://dom4j.github.io/
+public class Test {
+
+    public static void main(String[] args) throws Exception {
+//        read();
+
+        SAXReader reader = new SAXReader();
+        InputStream inputStream = ClassLoader.getSystemResourceAsStream("test.xml");
+        Document document = reader.read(inputStream);
+        Element rootElement = document.getRootElement();
+        traverse(rootElement, 0);
+    }
+
+    public static void read() throws Exception {
+        // 提供了一个阅读器
+        SAXReader reader = new SAXReader();
+        // 找到xml文件 读取出输入流
+        InputStream inputStream = ClassLoader.getSystemResourceAsStream("test.xml");
+        // 将输入流 加载成 文档对象
+        Document document = reader.read(inputStream);
+        // 获取文档中的根标签
+        Element rootElement = document.getRootElement();
+        // 根据根标签 获取所有子标签
+        List<Element> elements = rootElement.elements();
+//        for (Element element : elements) {
+//            // 对于每一个子标签 都包含了 元素 属性 文本
+//            System.out.println(element.getName());
+//            System.out.println(element.getText());
+//            System.out.println(element.attributeValue("sth"));
+//        }
+
+        // 用迭代器来遍历
+        Iterator<Element> iterator = rootElement.elementIterator();
+        while (iterator.hasNext()) {
+            Element element = iterator.next();
+            System.out.println(element.getName());
+        }
+    }
+
+    // 递归调用
+    public static void traverse(Element element, int depth) throws Exception {
+        System.out.println(element.getName());
+        System.out.println(element.getText());
+        List<Attribute> attributes = element.attributes();
+        for(Attribute attribute : attributes) {
+            System.out.println(attribute.getName() + " : " + attribute.getValue());
+        }
+
+        Iterator<Element> iterator = element.elementIterator();
+        while (iterator.hasNext()) {
+            Element child = iterator.next();
+            traverse(child, depth + 1);
+        }
+    }
+}

+ 7 - 0
xml-demo/src/main/resources/jdbc.properties

@@ -0,0 +1,7 @@
+# key = value???
+jdbc.url=jdbc:mysql://localhost:3306/test
+jdbc.driver=com.mysql.cj.jdbc.Driver
+jdbc.username=root
+jdbc.password=123456
+# key ?????
+#jdbc.password=123456

+ 3 - 0
xml-demo/src/main/resources/sth.properties

@@ -0,0 +1,3 @@
+#comments
+#Sun Nov 03 11:03:26 CST 2024
+sth=123456

+ 9 - 0
xml-demo/src/main/resources/student.dtd

@@ -0,0 +1,9 @@
+<!-- dtd 代表一种对xml的格式约束 -->
+<!-- 约束父标签下可以有多个子标签 -->
+<!ELEMENT students(student*)>
+<!ELEMENT student(name,age)>
+<!-- 设置标签 需要赋值为文本 -->
+<!ELEMENT name(#PCDATA)>
+<!ELEMENT age(#PCDATA)>
+<!-- 设置student标签内带有number属性 且不能重复 -->
+<!ATTLIST student number ID #REQUIRED>

+ 23 - 0
xml-demo/src/main/resources/student.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- 声明这是一个xml文件 声明版本号和编码格式 -->
+<!-- XML语法 + HTML约束 = HTML语法 -->
+<!-- 使用dtd文件来约束 xml -->
+<!DOCTYPE students SYSTEM "student.dtd">
+
+<!-- 还有一种约束 Schema  比dtd更加详细-->
+<students>
+    <student number="001">
+        <name>zhangsan</name>
+        <age>18</age>
+<!--        <desc>sth <![CDATA[ <> & ' "]]> </desc>-->
+        <!--   对特殊符号的支持  CDATA  支持字符数据的原样显示    -->
+    </student>
+    <student number="002">
+        <name>lisi</name>
+        <age>20</age>
+<!--        不允许student子标签中 有其他标签-->
+<!--        <desc>sth</desc>-->
+    </student>
+<!--    不允许students标签中 有除了student的标签-->
+<!--    <teacher></teacher>-->
+</students>

+ 11 - 0
xml-demo/src/main/resources/test.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- 准备一个简单的xml -->
+<root>
+    <item sth="something">
+        first item
+        <child>1111</child>
+        <child>2322</child>
+    </item>
+    <item1 sth="sth123">second item</item1>
+    <item2 sth="sth456">second item</item2>
+</root>