无忧启动论坛

标题: 【短平快】比记事本更好用的离线本地存储网页[念念不忘,必有返响]记事本! [打印本页]

作者: 879792799    时间: 3 天前
标题: 【短平快】比记事本更好用的离线本地存储网页[念念不忘,必有返响]记事本!
本帖最后由 879792799 于 2025-8-12 17:37 编辑

       提醒一下 千万拿此记事本保存账户 密码 银行卡之类 出了问题本人概不担责!!
          离线本地浏览器存储是不加密的  别放贵重信息!!!!仅供兴趣研究玩的!!


原帖是https://blog.csdn.net/2301_81253 ... ails/140924135-----有点问题我已修复
呵呵 有好东西不分享不是我风格!!此网页离线本地存储记事本 比一般记事本方便!
最有意思部分 就是这么复杂的数据存储  仅仅只用到二维数组就搞定了数学真的好强大 好强大啊!


大大们先让我感叹一下!太阳地下没有新鲜事,人生关键之处也就那么几步,真正重要的话也就那么几句!
所以记事本回归本质仅需要记录这几句话,真正重要的话!!长篇大论的话估计自己懒的看吧或者把自己也搞晕了.

#########################################################################

把真正重要几句的话每天重复坚持下去,此记事本助大大您念念不忘,必有返响!!
#########################################################################


           祝大大们早日练成绝世武功!
  







假如大大你嫌删除太小(我是防误删所以设的很小!) 可以调整349行  border-right: 10px solid #FD0164;
提醒 必须要有jquery.min.js 网上有!

  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="UTF-8" />
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.     <title>Document</title>
  7.     <style>
  8.     * {
  9.   margin: 0;
  10.   box-sizing: border-box;
  11. }

  12. a {
  13.   text-decoration: none;
  14. }


  15. body {
  16.    zoom: 56%;
  17.   margin-top: 20px;
  18.   height: 1000px;
  19.   background-repeat: no-repeat;
  20. }


  21. .entire {
  22.   margin: auto;
  23.   width:600px;
  24.   height: 1060px;
  25. }




  26. .button {
  27. border-radius: 6px;
  28. color: #505050;
  29. }


  30. /*    心平气和   */
  31. .title {
  32.   margin: auto;
  33.   width: 180px;
  34.   height: 44px;
  35.   font-size: 39px;
  36.   border-radius: 20px;
  37.   text-align: center;
  38.   margin-top: 9px;
  39.   color: #FD6600;
  40.   box-shadow: 5px 5px 15px rgb(201, 188, 198) inset, -5px -5px 10px  #999999 inset;
  41. }




  42. .header input {
  43. margin: auto;
  44. text-align: center;
  45.   margin-top: 60px;
  46. font-size: 30px;
  47.   width: 600px;
  48.   height: 69px;
  49.   border-radius: 30px;
  50.   border: none;
  51.   outline: none;
  52.   
  53.   color: #505050;
  54.   box-shadow: 5px 5px 15px rgb(219, 218, 218) inset, -5px -5px 10px #999999 inset;
  55. }

  56. input::placeholder {
  57.   color: #505050;
  58.   font-size: 29px;
  59. }

  60. .tabs {
  61.    margin: auto;
  62.     margin-top: 33px;
  63.     display: flex;
  64.     text-align: center;
  65.     border-bottom: 2px solid #e7b3b3;
  66. }

  67. .tabs div {
  68. margin-left: 30px;
  69.   background-color: #546171;
  70.   border: 2px solid #e7b3b3;
  71.   border-top-left-radius: 18px;
  72.   border-top-right-radius: 18px;
  73.   border-bottom: none;
  74.   font-size: 39px;
  75.   cursor: pointer;
  76.   color: #000000;
  77.   box-shadow: 5px 5px 15px rgb(250, 241, 241) inset, -5px -5px 10px #fff inset;
  78. }

  79. .tabs .active {
  80.   background-color: #FD9900;
  81. }

  82. .content {
  83.   padding-top: 0px;
  84. }

  85. .note {
  86.   padding-top: 20px;
  87.   margin: auto;
  88.   width:600px;
  89.   border-radius: 40px;
  90. }

  91. /* 设置各个tab面背景样式 和文字颜色 包括条目背景色*/
  92. .note:nth-child(1) {
  93.     background-color: #fffefe;
  94. }

  95. .note:nth-child(2) {
  96.   background-color: #fffefe;
  97. }

  98. .note:nth-child(2) .center-item {
  99.   color: #ffffff;
  100. }

  101. .note:nth-child(3) {
  102.   background-color: #fffefe;
  103. }

  104. .note:nth-child(3) .center-item {
  105.   color: #ffffff;
  106. }

  107. .note:nth-child(4) {
  108.   background-color: #fffefe;
  109. }

  110. .note:nth-child(4) .center-item {
  111.   color: #ffffff;}
  112.   
  113.   .note:nth-child(5) {
  114.   background-color: #fffefe;
  115. }

  116. .note:nth-child(5) .center-item {
  117. color: #ffffff;;
  118. }





  119. /* 设置完成和未完成的框的大小和样式 */
  120. .work-unfinished,
  121. .work-finished,
  122. .life-unfinished,
  123. .life-finished,
  124. .study-unfinished,
  125. .study-finished,
  126. .health-unfinished,
  127. .health-finished,
  128. .day-unfinished,
  129. .day-finished {
  130.   margin: auto;
  131.   width: 600px;
  132.   border-radius: 15px;
  133.   border: #ffffff solid 3px;
  134.   }

  135. /* 设置完成和未完成之间的间隔为20px */
  136. .work-unfinished,
  137. .life-unfinished,
  138. .study-unfinished,
  139. .health-unfinished,
  140. .day-unfinished{
  141.   margin-bottom: 100px;
  142. }

  143. /* 设置完成和未完成的字体样式 */
  144. .note-text {
  145.   margin-bottom: 15px;
  146.   width: 190px;
  147.   height: 50px;
  148.   color: #FD9900;
  149.   text-align: left;
  150.   font-size: 50px;
  151.   text-align: left;
  152.   font-weight:bold;
  153.   
  154. }


  155. /* 完成 未完成设置位置 */
  156. .work-unfinished .note-text,
  157. .life-unfinished .note-text,
  158. .study-unfinished .note-text,
  159. .health-unfinished .note-text,
  160. .day-unfinished .note-text {
  161.   margin-left: 0px;
  162.   text-align: left;
  163.   font-size: 35px;
  164. }


  165. /* 完成 已完成设置位置 */
  166. .work-finished .note-text,
  167. .life-finished .note-text,
  168. .study-finished .note-text,
  169. .health-finished .note-text,
  170. .day-finished .note-text {
  171.   margin-left: 0px;
  172. color: #505050;
  173.   text-align: left;
  174.   font-size: 35px;
  175. }

  176. /*条目宽度*/
  177. .uul-unfinished,
  178. .uul-finished {

  179.   display: block;
  180.   width: 600px;

  181.   overflow-y: hidden;
  182.   overflow-x: hidden;
  183. }


  184. /* 隐藏滚动条  */
  185. .uul-unfinished::-webkit-scrollbar,
  186. .uul-finished::-webkit-scrollbar {
  187.   width: 0;
  188. }

  189. /* 设置页面内各个条目的  重要  */
  190. .uul-unfinished li {
  191.   margin-top: 6px;
  192.   margin-left: -39px;
  193.   border-top-left-radius: 5px;
  194.   border-bottom-left-radius: 5px;
  195.   border-top-right-radius: 7px;
  196.   border-bottom-right-radius: 7px;
  197.   display: flex;
  198.   height: 51px;
  199.   width: 590px;
  200.   text-align: center;
  201.   font-size: 35px;
  202.   border-left: 12px solid #7BB01A;
  203. }


  204. .uul-finished li {
  205.   margin-top: 6px;
  206.   margin-left: -39px;

  207.   border-top-left-radius: 5px;
  208.   border-bottom-left-radius: 5px;
  209.   border-top-right-radius: 7px;
  210.   border-bottom-right-radius: 7px;
  211.   display: flex;
  212.   height: 33px;
  213.   width: 590px;
  214.   text-align: center;
  215.   font-size: 26px;
  216.   border-left: 12px solid #7BB01A;
  217. }




  218.   /* 设置页面内各个条目的外框  重要  */
  219. .work-unfinished .uul-unfinished li,
  220. .work-finished .uul-finished li {
  221.   box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  222.   background-color: #505050;

  223. }

  224. .life-unfinished .uul-unfinished li,
  225. .life-finished .uul-finished li {
  226.   box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  227.   background-color: #505050;

  228. }

  229. .study-unfinished .uul-unfinished li,
  230. .study-finished .uul-finished li {
  231.   box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  232.   background-color: #505050;

  233. }

  234. .health-unfinished .uul-unfinished li,
  235. .health-finished .uul-finished li {
  236.   box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  237.   background-color: #505050;

  238. }

  239. .day-unfinished .uul-unfinished li,
  240. .day-finished .uul-finished li {
  241.   box-shadow: 1px 1px 2px rgb(0, 0, 0) inset, -1px -1px 1px #000000 inset;
  242.   background-color: #505050;
  243.   
  244. }


  245. .center-item {
  246.   width: 570px;
  247.   height: 39px;
  248.   text-align: left;
  249.   margin-left: 10px;
  250.   overflow-y: hidden;
  251.   overflow-x: hidden;
  252.   color: #ffffff;
  253. }
  254.   
  255. /* 设置已完成文字样式*/
  256. .uul-finished .center-item {
  257.   text-decoration: line-through;
  258. color:#AC7F79;
  259. }

  260. .life-finished .uul-finished   .center-item {
  261. text-decoration: line-through;
  262. color:#AC7F79;
  263. }

  264. .study-finished .uul-finished   .center-item {
  265. text-decoration: line-through;
  266. color: #AC7F79;
  267. }

  268. .health-finished .uul-finished   .center-item {
  269. text-decoration: line-through;
  270. color: #AC7F79;
  271. }

  272. .day-finished .uul-finished   .center-item {
  273. text-decoration: line-through;
  274. color: #AC7F79;
  275. }


  276. /* 设置各个条目图标后面删除图标*/
  277. .task-iconsan {

  278. border-right: 10px solid #FD0164;
  279.   width:15px;
  280.   border-top-right-radius: 5px;

  281.   border-bottom-right-radius: 5px;
  282.   
  283. }


  284. /* 设置变签内容不可看 */
  285. .note {
  286.   display: none;
  287. }

  288. /* 设置变迁内容可看 */
  289. .content .active {
  290.   display: block;
  291. }

  292. /* 设置完成文字图片在一排 */
  293. .text {
  294.   display: flex;
  295. }

  296. /* 每天重心开始 */
  297. .deleteAll {
  298.   cursor: pointer;
  299.   width: 100px;
  300.   height: 50px;
  301.   margin-top: 9px;
  302.   margin-right: 10px;
  303. }

  304. .text img {
  305.   width: 0px;
  306.   height: 0px;
  307.   border-radius: 0px;
  308.   margin-right: 10px;
  309.   margin-left: 10px;
  310.   margin-top: 4px;
  311. }

  312. /*全部删除这几个字*/
  313. .text span {
  314.   width: 120px;
  315.   height: 40px;
  316.   text-align: center;
  317.   vertical-align: middle;
  318.   color: #000000;
  319.   font-size: 20px;
  320.   padding: 4px;
  321.   border-radius: 15px;
  322.   border: 1px solid rgb(255, 217, 142);
  323. }
  324.     </style>
  325.         
  326.         <script type="text/javascript" src="./jquery.min.js"></script>
  327.         <!--使用高版本jquery请调用jquery-migrate-1.2.1.min.js,低版本可不用-->

  328.     </head>
  329.   
  330.   
  331.   <body>
  332.   <!-- 设置便签整体 -->
  333.     <div class="entire">
  334.     <!-- 设置便签头部 -->
  335.         <div class="header">
  336.         <!--  <div class="title">心平气和 </div>-->
  337.     <input id="task" type="text"     placeholder="   心   想   事   成   ">
  338.                 <!--        <input value="导入(txt/json)" type="file" class="btn-small action-import" id="importtt">   -->
  339.                 <!-- <input type="file" id="im.port-file" accept=".txt,.json" style="display:none"> -->
  340.     </div>

  341.     <!-- 设置中部 -->
  342.     <div class="middle">
  343.       <!-- 设置中间tab栏部分 -->
  344.       <div class="tabs">
  345.         <!-- 设置4个内容便签tab -->
  346.         <div class="work active" data-id="1">紧急</div>
  347.         <div class="life" data-id="2">重要</div>
  348.         <div class="study" data-id="3">兴趣</div>
  349.         <div class="health" data-id="4">长期</div>
  350.                 <div class="day" data-id="5">随记</div>
  351.       
  352.       </div>

  353.       <!-- 设置中间内容部分 -->
  354.       <div class="content">

  355.         <!-- 设置第一个便签内容 -->
  356.         <div class="note active">
  357.           <div class="work-unfinished">
  358.             <div class="note-text" >未完成</div>
  359.          
  360.             <ul class="uul-unfinished">
  361.       
  362.             </ul>
  363.           </div>
  364.           <div class="work-finished">
  365.             <div class="text">
  366.               <div class="note-text">已完成</div>
  367.               <span class="deleteAll"  style="margin-right: 79px;text-align: center;">每天重❤来</span>
  368.               
  369.             </div>
  370.             
  371.             <ul class="uul-finished">
  372.       
  373.             </ul>
  374.           </div>
  375.         </div>

  376.         <!-- 设置第二个便签内容 -->
  377.         <div class="note">
  378.           <div class="life-unfinished">
  379.                         <div class="note-text" >未完成</div>
  380.    
  381.             <ul class="uul-unfinished">
  382.             
  383.             </ul>
  384.           </div>
  385.           <div class="life-finished">
  386.             <div class="text">
  387.               <div class="note-text">已完成</div>
  388.                           <span class="deleteAll"  style="margin-right: 79px;text-align: center;">每天重❤来</span>
  389.               
  390.             </div>
  391.          
  392.             <ul class="uul-finished">
  393.       
  394.             </ul>
  395.           </div>
  396.         </div>

  397.         <!-- 设置第三个便签内容 -->
  398.         <div class="note">
  399.           <div class="study-unfinished">
  400.             <div class="note-text" >未完成</div>
  401.          
  402.             <ul class="uul-unfinished">
  403.             
  404.             </ul>
  405.           </div>
  406.           <div class="study-finished">
  407.             <div class="text">
  408.               <div class="note-text">已完成</div>
  409.                           <span class="deleteAll"  style="margin-right: 79px;text-align: center;">每天重❤来</span>
  410.               
  411.             </div>
  412.          
  413.             <ul class="uul-finished">
  414.             
  415.             </ul>
  416.           </div>
  417.         </div>

  418.                 <!-- 设置第四个便签内容 -->
  419.         <div class="note">
  420.           <div class="health-unfinished">
  421.             <div class="note-text">未完成</div>

  422.             <ul class="uul-unfinished">

  423.             </ul>
  424.           </div>
  425.           <div class="health-finished">
  426.             <div class="text">
  427.               <div class="note-text">已完成</div>
  428.                           <span class="deleteAll"  style="margin-right: 79px;text-align: center;">每天重❤来</span>

  429.             </div>

  430.             <ul class="uul-finished">

  431.             </ul>
  432.           </div>
  433.         </div>
  434.                
  435.                
  436.         <!-- 设置第五个便签内容 -->
  437.         <div class="note">
  438.           <div class="day-unfinished">
  439.             <div class="note-text" >未完成</div>
  440.            
  441.             <ul class="uul-unfinished">
  442.            
  443.             </ul>
  444.           </div>
  445.           <div class="day-finished">
  446.             <div class="text">
  447.               <div class="note-text">已完成</div>
  448.                           <span class="deleteAll"  style="margin-right: 79px;text-align: center;">每天重❤来</span>
  449.               
  450.             </div>
  451.          
  452.             <ul class="uul-finished">
  453.          
  454.             </ul>
  455.           </div>
  456.         </div>

  457.       </div>
  458.     </div>

  459.   </div>



  460.     <script>
  461.          
  462.   window.addEventListener('load', function () {
  463.   // 判断到第几个note
  464.   let dataId = 1
  465.   //定义数组
  466.   if (!this.localStorage.getItem('arr')) {
  467.     localStorage.setItem('arr', "[[], [], [], [],[]]")

  468.   } else if (!this.localStorage.getItem('arr1')) {
  469.     localStorage.setItem('arr1', "[[], [], [], [],[]]")
  470.   }
  471.   const arrList1 = JSON.parse(localStorage.getItem('arr'))
  472.   const arrList2 = JSON.parse(localStorage.getItem('arr1'))


  473. renderUnfinished()
  474. renderFinished()
  475. bindEventListeners()

  476.   // 如果按下了回车事件
  477.   let inputTask = document.querySelector('#task')
  478.   inputTask.addEventListener('keydown', function (e) {
  479.     if (e.key === 'Enter') {
  480.       let newTaskText = inputTask.value.trim()
  481.       if (newTaskText !== '') {
  482.         arrList1[dataId - 1].push(newTaskText)
  483.         localStorage.setItem('arr', JSON.stringify(arrList1))
  484.         //更新未完成事件界面
  485.         renderUnfinished()
  486.         //将input设为空
  487.         inputTask.value = ''
  488.       }
  489.     }
  490.   })

  491.   

  492.   
  493.   
  494.   // 点击tabs
  495.   let tabs = document.querySelector('.tabs')

  496.     var fntab = function (e){
  497.     if (e.target.tagName === 'DIV' && e.target.hasAttribute('data-id')) {
  498.       document.querySelector('.tabs .active').classList.remove('active')
  499.       e.target.classList.add('active')
  500.       dataId = e.target.dataset.id

  501.    document.querySelector('.content .active').classList.remove('active')
  502.    document.querySelector(`.content .note:nth-child(${dataId})`).classList.add('active')
  503.       // 更新两个界面
  504.       renderFinished()
  505.       renderUnfinished()
  506.      bindEventListeners()
  507.    //   alert("标签页码==="+(dataId - 1));
  508.     //  e.stopPropagation()
  509.    event.stopPropagation()
  510.     //   tabs.removeEventListener('click',fntab);
  511.      //  tabs.addEventListener('click',fntab);
  512.           }};
  513.   
  514.   //  tabs.removeEventListener('click',fntab);
  515. //    tabs.addEventListener('click',fntab);
  516.   
  517. $(".tabs").unbind("click").bind("click",fntab);

  518. ///////////////////////自己定义函数////////////////////////////////////


  519.   //下面是全部重新开始
  520.           function exportLocalStorageAsJsonguili(e) {
  521.          
  522.           const arrList1 = JSON.parse(localStorage.getItem('arr'))
  523.       const arrList2 = JSON.parse(localStorage.getItem('arr1'))
  524.       const arr=arrList1.map((row,index) =>  [...row, ...arrList2[index]]);
  525.         //          arrList2 = [];
  526.                 localStorage.setItem('arr1', "[[], [], [], [],[]]")
  527.     //    localStorage.setItem('arr1', JSON.stringify(arrList2));
  528.                 localStorage.setItem('arr' ,  JSON.stringify(arr));
  529.         renderFinished();
  530.                 renderUnfinished();
  531.                 $(`.note:nth-child(${dataId}) .uul-unfinished`).unbind("click").bind("click",fnw);
  532.             $(`.note:nth-child(${dataId}) .uul-finished`).unbind("click").bind("click",fnni);
  533.           }
  534.          
  535.           $(".guilin").unbind("click").bind("click",exportLocalStorageAsJsonguili);
  536.                   
  537.                   
  538.         
  539.                   
  540.                   
  541.         
  542.                   
  543. ///////////////////////////////////////////////////////////
  544.   // 绑定事件监听器
  545.   function bindEventListeners() {
  546.     let un_ul = document.querySelector(`.note:nth-child(${dataId}) .uul-unfinished`)
  547.     let ul = document.querySelector(`.note:nth-child(${dataId}) .uul-finished`)
  548.     let cxin = document.querySelector(`.note:nth-child(${dataId}) .deleteAll`)
  549.   // 删除未完成
  550.    var fn = function (e){
  551.        if (e.target.classList.contains('delete')){
  552.                   let index = parseInt(e.target.dataset.id)
  553.                 //          alert("行号===="+(index));
  554.       arrList1[dataId - 1].splice(index, 1)
  555.              //          alert("标签页码==="+(dataId - 1));
  556.             //    console.log(dataId - 1);
  557.         localStorage.setItem('arr', JSON.stringify(arrList1))
  558.         renderUnfinished()
  559.         event.stopPropagation()
  560.       }};
  561.    
  562.    
  563.     $(`.note:nth-child(${dataId}) .uul-unfinished`).unbind("click").bind("click",fn);
  564.    
  565.    
  566.    
  567.   // 删除已完成
  568.    var fnyi = function (e){
  569.         if (e.target.classList.contains('delete22')) {
  570.         let index = parseInt(e.target.dataset.id)
  571.             //                        alert("行号yi===="+(index));
  572.         // console.log(dataID)
  573.         arrList2[dataId - 1].splice(index, 1)
  574.         //        alert("标签页码yi==="+(dataId - 1));
  575.         localStorage.setItem('arr1', JSON.stringify(arrList2))
  576.         renderFinished()
  577.          event.stopPropagation()
  578.       }};

  579.   $(`.note:nth-child(${dataId}) .uul-finished`).unbind("click").bind("click",fnyi);
  580.    

  581.         
  582.           //  nxnx 每天重新开始   就是把完成数组加入到未完成数组
  583.     cxin.addEventListener('click', function (e) {
  584.         if (e.target.tagName === 'SPAN') {
  585.         arrList1[dataId - 1] .push(...arrList2[dataId - 1]);
  586.         arrList2[dataId - 1] = [];
  587.         localStorage.setItem('arr1', JSON.stringify(arrList2));
  588.                 localStorage.setItem('arr' ,  JSON.stringify(arrList1));
  589.         renderFinished();
  590.                 renderUnfinished();
  591.         }
  592.             })
  593.         

  594.                         
  595. // 点击未完成按钮任务变成完成
  596.         var fnw = function (e){
  597.         if (e.target.classList.contains('center-item')) {
  598.         let dataName = parseInt(e.target.dataset.name);
  599.         arrList2[dataId - 1].push(arrList1[dataId - 1][dataName]);      
  600.                 arrList1[dataId - 1].splice(dataName, 1);
  601.                
  602.         localStorage.setItem('arr1', JSON.stringify(arrList2));
  603.         localStorage.setItem('arr', JSON.stringify(arrList1));
  604.         renderFinished();
  605.         renderUnfinished();
  606.       
  607.       }};
  608.   
  609.    $(`.note:nth-child(${dataId}) .uul-unfinished`).unbind("click").bind("click",fnw);
  610.    $(`.note:nth-child(${dataId}) .uul-unfinished`).bind("click",fn);
  611.    
  612.    
  613.         
  614. //nxnx   点击yiyiyi完成按钮任务变成完成
  615.         var fnni = function (e){
  616.     if (e.target.classList.contains('center-item')) {
  617.         let dataName = parseInt(e.target.dataset.name);
  618.         arrList1[dataId - 1].push(arrList2[dataId - 1][dataName]);
  619.         arrList2[dataId - 1].splice(dataName, 1);
  620.         localStorage.setItem('arr1', JSON.stringify(arrList2));
  621.         localStorage.setItem('arr', JSON.stringify(arrList1));
  622.         renderFinished();
  623.         renderUnfinished();
  624.             
  625.       }};

  626. $(`.note:nth-child(${dataId}) .uul-finished`).unbind("click").bind("click",fnni);
  627. $(`.note:nth-child(${dataId}) .uul-finished`).bind("click",fnyi);

  628. }



  629.   // 更新未完成
  630.   function renderUnfinished() {
  631.     let un_ul = document.querySelector(`.note:nth-child(${dataId}) .uul-unfinished`);
  632.     const listItems = JSON.parse(localStorage.getItem('arr'))[dataId - 1].map((taskText, index) => {
  633.       return `
  634.       <li>
  635.         <div class="center-item"    data-name="${index}" >${taskText}</div>
  636.         <div class="delete task-iconsan"  data-id="${index}"  > </div>
  637.       </li>
  638.     `
  639.     }).join('')
  640.     un_ul.innerHTML = listItems
  641.   }


  642.   // 更新已完成
  643.   function renderFinished() {
  644.     let ul = document.querySelector(`.note:nth-child(${dataId}) .uul-finished`);
  645.     const listItems = JSON.parse(localStorage.getItem('arr1'))[dataId - 1].map((taskText, index) => {
  646.       return `
  647.       <li>
  648.         <div class="center-item"    data-name="${index}"  >${taskText}</div>
  649.         <div class="delete22 task-iconsan"  data-id="${index}" > </div>
  650.       </li>
  651.     `
  652.     }).join('')
  653.     ul.innerHTML = listItems
  654.   }
  655.   

  656. })
  657.     </script>
  658.   </body>
  659. </html>

复制代码
提醒 必须要有jquery.min.js 网上有!





感谢20#提供jquery.min.js 文件下载!








作者: 879792799    时间: 3 天前
本帖最后由 879792799 于 2025-8-12 07:36 编辑

最有意思部分 就是这么复杂的数据存储  仅仅只用到二维数组就搞定了数学真的好强大 好强大啊!


作者: 燕飞龙    时间: 3 天前
谢谢分享
作者: ylac    时间: 3 天前
刚好有需要记录,下来试试,谢谢楼主
作者: huxingzhuang    时间: 3 天前
反正我不懂,一个字,牛。
作者: czg2008    时间: 3 天前
挺好的,谢谢
作者: wn168cn@163.com    时间: 3 天前
感谢楼主分享 !
作者: dkzzlf    时间: 3 天前
围观一下
作者: 小灰兔    时间: 3 天前
感谢楼主分享
作者: Gzhq3721456    时间: 3 天前
不懂,膜拜了。
作者: holley2008    时间: 3 天前
感谢分享
作者: sf9608    时间: 3 天前
谁能提供一个jquery.min.js
作者: 201012121135    时间: 3 天前
谢谢分享
作者: 甲方    时间: 3 天前
不懂呢
作者: view520    时间: 3 天前
感谢分享
作者: ynb168c    时间: 3 天前

感谢分享!
作者: 2810401407    时间: 3 天前
感谢分享
作者: cc2025    时间: 3 天前
感谢分享
作者: uouobb    时间: 3 天前
支持,感谢分享
作者: yxldh    时间: 3 天前
感谢楼主分享

jquery.min.zip

30.17 KB, 下载次数: 63, 下载积分: 无忧币 -2


作者: 小龙飞    时间: 3 天前
感谢您的分享!
作者: a68032611    时间: 3 天前
感谢您的分享!
作者: guong    时间: 3 天前
感谢分享 !
作者: 小灰猪    时间: 3 天前
感谢分享
作者: jh198354    时间: 3 天前
谢谢分享!!!
作者: xtayspwk    时间: 3 天前
好像很不错,感谢分享
作者: 879792799    时间: 3 天前
yxldh 发表于 2025-8-12 09:55
感谢楼主分享

感谢大大热心帮忙!!!
作者: valen21    时间: 3 天前
感谢分享
作者: 进士小站    时间: 3 天前
感谢分享
看起来很复杂啊
作者: 879792799    时间: 3 天前
进士小站 发表于 2025-8-12 11:56
感谢分享
看起来很复杂啊

小网页而已
作者: 879792799    时间: 3 天前
sf9608 发表于 2025-8-12 08:35
谁能提供一个jquery.min.js

20#有附件可以下  和网页放在同一个目录下就行了!
作者: zhxhwyzh14    时间: 3 天前
jquery.min.js 版本用多少合适
作者: lbw2007    时间: 3 天前
说实话,好久没见人用js写html应用了。很优秀!
玩玩可以,千万别投入太多精力。否则项目一大就变成意大利面代码了。
或者直接用AI把你的代码做一下分层,方便后续代码维护。
作者: tanglf    时间: 3 天前
不错的记事本,不是笔记本
作者: zhou116yan    时间: 3 天前
谢谢分享
作者: 879792799    时间: 3 天前
zhxhwyzh14 发表于 2025-8-12 12:02
jquery.min.js 版本用多少合适

估计一般都可以吧!别太老版本!
作者: 879792799    时间: 3 天前
lbw2007 发表于 2025-8-12 12:05
说实话,好久没见人用js写html应用了。很优秀!
玩玩可以,千万别投入太多精力。否则项目一大就变成意大利 ...

向真正的 大佬学习了!
作者: aranya    时间: 3 天前
想知道最后数据存储到什么地方了,如何可以导出来?
作者: a583091790    时间: 3 天前
能POST吗

作者: lifufu8888    时间: 3 天前
谢谢楼主分享
作者: xbao007    时间: 3 天前
好像有点用 收藏了
作者: HDIY    时间: 3 天前

作者: holley2008    时间: 3 天前
之前那个主题没运行起来,这个可以。觉得删除太小,可以把border-right调大一点
作者: 879792799    时间: 3 天前
aranya 发表于 2025-8-12 12:55
想知道最后数据存储到什么地方了,如何可以导出来?

百度 localStorage

数据存储到什么地方----先F12打开检查然后按图片数字顺序找


作者: fegr    时间: 3 天前
谢谢分享
作者: wangyi4160    时间: 3 天前
感谢分享
看起来很复杂啊
作者: wangyi4160    时间: 3 天前
法律专家警告,这项史无前例的“付费换许可”协议很可能诉诸法庭,其合法性也因涉嫌构成“给联邦政府的回扣”而受到质疑。
作者: aranya    时间: 3 天前
879792799 发表于 2025-8-12 13:41
百度 localStorage

数据存储到什么地方----先F12打开检查然后按图片数字顺序找

这样不能导出保存只能说不重要的临时用一下还行。
作者: ster1357A    时间: 3 天前
很优秀的代码
作者: hmaaaa    时间: 3 天前
感謝你無私的分享,感恩喔 ^^!辛苦了!
作者: 奈绪    时间: 3 天前
代码不知道如何使用,太遗憾了。
作者: 879792799    时间: 3 天前
奈绪 发表于 2025-8-12 15:55
代码不知道如何使用,太遗憾了。

呵呵 我吹牛的  就是个小网页而已 网上多得是啊!
作者: yzydys    时间: 3 天前
感谢楼主分享!
作者: 879792799    时间: 3 天前
aranya 发表于 2025-8-12 15:03
这样不能导出保存只能说不重要的临时用一下还行。

网上找了一段  你试试 再修改修改 看看行不行?

<BUTTON id="daochu" onclick=daochuLocalStorageAsJson() >导出json</BUTTON>

上面是按钮加入<body>区 非<script>区



下面是触发代码  加入<script>区  不行自己再调整位置  
function daochuLocalStorageAsJson() {
var localStoragedate=localStorage.getItem('arr')+localStorage.getItem('arr1');
  var data = JSON.stringify(localStoragedate); // 转换localStorage为JSON字符串
  const blob = new Blob([data], {type: "text/plain;charset=utf-8"}); // 创建Blob对象
  var url = URL.createObjectURL(blob); // 获取下载链接
var link = document.createElement('a');
link.href = url;
  link.download = 'daochu.json'; // 设置下载文件名
link.style.display="none";
  document.body.appendChild(link);
  link.click(); // 触发下载
  link.remove(); // 移除元素(可选)

  alert(("已导出"));
   
}


自己再修改看看  不保证可以使用  我也是菜鸟啊
作者: kiwiairui    时间: 3 天前
感谢大佬分享              
作者: RNM25728    时间: 3 天前
谢谢分享
作者: Zhengqiang5q    时间: 3 天前
不同凡响,云淡风轻晚上好!
作者: jjhtya    时间: 3 天前
谢谢分享
作者: 2013WCL    时间: 3 天前
能不能打包呀  自己组合不行
作者: wang1126    时间: 前天 07:58
谢谢楼主分享
作者: dksoft    时间: 前天 08:09
感谢分享
作者: handsome_xiang    时间: 昨天 01:30
感谢分享!
作者: android    时间: 昨天 07:08
本帖最后由 android 于 2025-8-14 07:21 编辑

为什么我打开的界面跟你的不一样

2025-8-14 7-20-33.png (28.18 KB, 下载次数: 0)

2025-8-14 7-20-33.png

作者: 879792799    时间: 昨天 09:37
本帖最后由 879792799 于 2025-8-14 09:43 编辑
android 发表于 2025-8-14 07:08
为什么我打开的界面跟你的不一样

最上面 心想事成是输入框    你自己输入啊!!


作者: android    时间: 昨天 11:30
879792799 发表于 2025-8-14 09:37
最上面 心想事成是输入框    你自己输入啊!!

好的,谢谢




欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3