沃梦达 / IT编程 / 前端开发 / 正文

node.js实现带进度条的多文件上传

关于“node.js实现带进度条的多文件上传”的攻略,可以分为以下几个步骤:

关于“node.js实现带进度条的多文件上传”的攻略,可以分为以下几个步骤:

1. 搭建服务端

首先需要建立一个node.js的服务端应用,可以使用express框架来快速搭建。具体步骤如下:

  1. 安装express模块:

bash
npm install --save express

  1. 在项目目录下新建一个名为app.js的文件。

  2. app.js文件中引入express模块:

javascript
const express = require('express');

  1. 创建一个express应用:

javascript
const app = express();

  1. 添加一个路由处理文件上传请求:

javascript
app.post('/upload', (req, res) => {
// 文件上传处理代码
});

  1. 启动应用,监听指定端口:

javascript
const server = app.listen(3000, () => {
console.log('Server started on port 3000');
});

2. 实现多文件上传处理

接下来需要实现多文件上传的处理。可以使用multer模块来实现文件上传的中间件功能。

  1. 安装multer模块:

bash
npm install --save multer

  1. app.js文件中引入multer模块:

javascript
const multer = require('multer');

  1. 创建一个multer实例:

``` javascript
const storage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, 'uploads/');
},
filename: (req, file, cb) => {
cb(null, file.originalname);
}
})

const upload = multer({ storage: storage });
```

  1. 在处理文件上传的路由中使用multer中间件:

javascript
app.post('/upload', upload.array('files'), (req, res) => {
res.json({ message: 'Files uploaded successfully.' });
});

  1. multer中的upload.array('files')方法表示接受名为files的文件数组,可以多选上传。

3. 添加进度条功能

最后一步是添加进度条功能。可以使用progressbar模块来实现。

  1. 安装progressbar模块:

bash
npm install --save progressbar

  1. app.js文件中引入progressbar模块:

javascript
const ProgressBar = require('progressbar.js');

  1. 在处理文件上传的路由中添加进度条逻辑:

``` javascript
app.post('/upload', upload.array('files'), (req, res) => {
// 创建进度条实例
const bar = new ProgressBar.Circle('#progress', {
color: '#aaa',
strokeWidth: 4,
trailWidth: 1,
duration: 3000,
text: {
value: '0 %',
className: 'progressbar__label'
},
step: function(state, bar) {
const value = Math.round(bar.value() * 100);
bar.setText(value + ' %');
}
});

 // 计算上传进度
 const total = req.files.length;
 let count = 0;
 req.files.forEach(file => {
   const reader = new FileReader();
   reader.readAsDataURL(file.buffer);
   reader.onloadend = () => {
     count++;
     const progress = Math.round((count / total) * 100) / 100;
     bar.animate(progress);
     if (count === total) {
       res.json({ message: 'Files uploaded successfully.' });
     }
   };
 });

});
```

  1. 添加一个HTML页面,用于上传多个文件:

``` html




Node.js File Upload with ProgressBar Example <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/progressbar.js/1.0.1/progressbar.min.css" /><style> #progress { width: 200px; height: 200px; margin: 20px auto; } .progressbar__label { font-size: 24px; font-weight: bold; color: #aaa; } <p> <br /> <body></p> <h1>Upload multiple files with progressbar</h1> <form id="upload-form" method="post" action="/upload" enctype="multipart/form-data"> <input type="file" name="files" multiple><br /> <br /> <button type="submit">Upload</button><br /> </form> <div id="progress"></div> <p> <script src="https://cdnjs.cloudflare.com/ajax/libs/progressbar.js/1.0.1/progressbar.min.js"><br /> <script> const form = document.getElementById('upload-form'); form.addEventListener('submit', (event) => { event.preventDefault();</p> <p> const xhr = new XMLHttpRequest(); xhr.open('POST', '/upload'); xhr.onload = () => { console.log('Upload completed.'); }; xhr.onerror = () => { console.log('Error occurred while uploading.'); }; xhr.upload.onprogress = (event) => { const loaded = event.loaded; const total = event.total; const progress = Math.round((loaded / total) * 100); console.log(progress + '% uploaded.'); };</p> <p> const files = form.files.files; const formData = new FormData(); for (let i = 0; i < files.length; i++) { formData.append('files', files[i], files[i].name); } xhr.send(formData); }); </script><br /> <br /> </html></p> <p>```</p> <p>以上就是完整的“node.js实现带进度条的多文件上传”的攻略了。下面再给出几个示例:</p> <h2>示例一</h2> <p>假设现在需要上传一个名为<code>example1.jpg</code>的图片和一个名为<code>example2.jpg</code>的图片。</p> <ol> <li> <p>打开刚刚创建的HTML页面。</p> </li> <li> <p>选择需要上传的两张图片文件并点击“Upload”按钮。</p> </li> <li> <p>界面中将显示进度条,进度条将从0%开始进行动画,同时控制台中会显示上传的进度。</p> </li> <li> <p>当上传完成后,控制台会输出“Upload completed.”的提示信息,同时进度条显示100%。</p> </li> </ol> <h2>示例二</h2> <p>假设现在需要上传一个名为<code>example3.jpg</code>的图片和一个名为<code>example4.jpg</code>的图片。</p> <ol> <li> <p>得出上述两张图片的文件大小分别为100KB和200KB,总大小为300KB。</p> </li> <li> <p>打开刚刚创建的HTML页面。</p> </li> <li> <p>选择需要上传的两张图片文件并点击“Upload”按钮。</p> </li> <li> <p>界面中将显示进度条,进度条将从0%开始进行动画,同时控制台中会显示上传的进度。</p> </li> <li> <p>上传过程中,进度条显示的上传进度将根据实际上传进度更新,控制台中将持续输出上传的进度。</p> </li> <li> <p>当上传完成后,控制台会输出“Upload completed.”的提示信息,同时进度条显示100%。</p> </li> </ol></input></p> </article> <script src='/adv.php?aid=2' language='javascript'></script> <!--标签--> <div class="wmd-margin-top b-t"> <div class="tags-item wmd-single-tags"> </div> </div></div> <div class="wmd-background-default b-b wmd-margin-bottom b-r-4"> <div class="wmd-text-small wmd-panding-s"> <div class="single-head"> <div class="wmd-text-small wmd-text-muted wmd-flex wmd-text-truncate wmd-overflow-auto"> <div class="avatar wmd-flex-1 wmd-flex wmd-flex-middle wmd-avatar-t"> <span class="wmd-text-small wmd-display-block wmd-margin-small-left"><a title="文章作者" rel="author">沃梦达教程</a></span> <p>本文标题为:node.js实现带进度条的多文件上传</p> <button id="TKLS" class="wmd-text-fz itemCopy red_tkl button_tkl" type="button" data-clipboard-text="node.js实现带进度条的多文件上传:https://www.womengda.net/nav/web/118775.html"><i class="iconfont icon-attachment"></i>复制本文链接</button> <div class="share"> <a class="weixin-share wmd-display-inline-block wmd-fx-weixin" href="#" wmd-tooltip="分享到微信" data-image="" target="_blank"><i class="iconfont icon-wechat-fill"></i></a> <a class="wmd-display-inline-block wmd-fx-qq" href="http://connect.qq.com/widget/shareqq/index.html?url=https://www.womengda.net/nav/web/118775.html&sharesource=qzone&title=node.js实现带进度条的多文件上传&pics=/xwassets/images/default.png&h=200&w=300&zc=1&a=t&q=100&s=1&summary=关于“node.js实现带进度条的多文件上传”的攻略,可以分为以下几个步骤:…" wmd-tooltip="分享到QQ好友/QQ空间" target="_blank"><i class="iconfont icon-QQ"></i></a> <a class="wmd-display-inline-block wmd-fx-weibo" href="http://service.weibo.com/share/mobile.php?url=https://www.womengda.net/nav/web/118775.html&title=node.js实现带进度条的多文件上传&appkey=3313789115" wmd-tooltip="分享到微博" target="_blank"><i class="iconfont icon-weibo1"></i></a> </div> </div> </div> </div> </div> </div> <script src="https://www.womengda.net/xwassets/js/clipboard.min.js" type="text/javascript"></script> <script> var clipboard = new Clipboard('.itemCopy'); clipboard.on('success', function(e) { if (e.trigger.disabled == false || e.trigger.disabled == undefined) { e.trigger.innerHTML = "<i class='iconfont icon-attachment'></i>链接复制成功"; e.trigger.disabled = true; setTimeout(function() { e.trigger.innerHTML = "<i class='iconfont icon-attachment'></i>复制本文链接"; e.trigger.disabled = false; }, 2000); } }); clipboard.on('error', function(e) { e.trigger.innerHTML = "链接复制失败"; }); </script> <div class="wmd-grid-small wmd-margin-bottom" wmd-grid> <div class='wmd-width-1-2'> <div class='b-r-4 wmd-inline wmd-overflow-hidden wmd-width-1-1 wmd-page-img' style='height:100px'> <img width='400' height='267' src='/xwassets/images/pre.png' class='attachment- size- wp-post-image' alt='' decoding='async' loading='lazy' srcset='/xwassets/images/pre.png 400w, /xwassets/images/pre.png 300w' sizes='(max-width: 400px) 100vw, 400px' /> <div class='wmd-overlay wmd-overlay-primary wmd-position-bottom'> <span>上一篇:</span> <a href='/nav/web/118774.html' class='wmd-display-block wmd-text-truncate'>pdf2swf+flexpapers实现类似百度文库pdf在线阅读</a> </div> </div> </div> <div class='wmd-width-1-2'> <div class='b-r-4 wmd-inline wmd-overflow-hidden wmd-width-1-1 wmd-page-img' style='height:100px'> <img width='400' height='267' src='/xwassets/images/next.png' class='attachment- size- wp-post-image' alt='' decoding='async' loading='lazy' srcset='/xwassets/images/next.png 400w, /xwassets/images/next.png 300w' sizes='(max-width: 400px) 100vw, 400px' /> <div class='wmd-overlay wmd-overlay-primary wmd-position-bottom'> <span>下一篇:</span> <a href='/nav/web/118776.html' class='wmd-display-block wmd-text-truncate'>vue下拉刷新组件的开发及slot的使用详解</a> </div> </div> </div> </div> <script src='https://www.womengda.net/adv.php?aid=3' language='javascript'></script> <!--猜你喜欢--> <section id="ceoxiangguan" class="wmd-background-default b-b wmd-margin-bottom-20 wmd-margin-top-20 b-r-4 wmd-padding-30px wmd-xiangguan"> <div class="wmd-xiangguan-wen"> <div class="wmd-qa-commont"> <span class="wmd-qa-turn"><i class="iconfont icon-xiangkan"></i> 猜你喜欢</span> </div> <ul class="xgart-row"> <li> <a href="/nav/web/94032.html" target="_blank" >Fly拦截全局Ajax请求的方法</a> <span>2023-02-23</span> </li> <li> <a href="/nav/web/13.html" target="_blank" >使用AngularJS2中的指令实现按钮的切换效果</a> <span>2022-07-07</span> </li> <li> <a href="/nav/web/118769.html" target="_blank" >用Flutter做桌上弹球(绘图(Canvas&CustomPaint)API)</a> <span>2023-12-23</span> </li> <li> <a href="/nav/web/80829.html" target="_blank" >关于 css:带有 SVG 文本动画 (CSS3) 的工件</a> <span>2022-09-21</span> </li> <li> <a href="/nav/web/88067.html" target="_blank" >深入浅析AjaxFileUpload实现单个文件的 Ajax 文件上传库</a> <span>2022-12-15</span> </li> <li> <a href="/nav/web/107036.html" target="_blank" >HTML5 video标签的poster属性图片铺满整个屏幕</a> <span>2023-07-08</span> </li> <li> <a href="/nav/web/118767.html" target="_blank" >兼容Firefox和IE的onpropertychange事件oninput</a> <span>2023-12-23</span> </li> <li> <a href="/nav/web/90896.html" target="_blank" >下拉菜单的级联操作(ajax)</a> <span>2023-01-21</span> </li> <li> <a href="/nav/web/114267.html" target="_blank" >Web应用开发(Servlet+html+Mysql)入门小示例</a> <span>2023-10-25</span> </li> <li> <a href="/nav/web/107171.html" target="_blank" >写给小白学习的地理信息的表示法GeoJSON</a> <span>2023-07-09</span> </li> </ul> </div> </section> </div> </div> <div class="wmd-side-lie-y sidebar-column"> <div class="sidebar"> <section class="side-author b-a b-r-4 wmd-background-default wmd-overflow-hidden wmd-margin-bottom"> <div class="side-author-latest wmd-background-default wmd-padding-small"> <div class="b-b wmd-padding-top-small wmd-padding-remove-horizontal wmd-clearfix wmd-flex wmd-flex-middle"> <span class="side-title side-title-style wmd-h5 wmd-float-left wmd-margin-remove wmd-position-relative">最新文章</span> </div> <ul class="wmd-padding-remove wmd-margin-remove-bottom"> <li class="wmd-margin-small-bottom wmd-position-relative"> <span>2023-12-23</span> <a href="/nav/web/118774.html" target="_blank" class="wmd-display-block">pdf2swf+flexpapers实现类似百度文库pdf在线阅读</a> </li> <li class="wmd-margin-small-bottom wmd-position-relative"> <span>2023-12-23</span> <a href="/nav/web/118773.html" target="_blank" class="wmd-display-block">ASP.NET搭配Ajax实现搜索提示功能</a> </li> <li class="wmd-margin-small-bottom wmd-position-relative"> <span>2023-12-23</span> <a href="/nav/web/118772.html" target="_blank" class="wmd-display-block">VBS一键配置VOIP脚本代码</a> </li> <li class="wmd-margin-small-bottom wmd-position-relative"> <span>2023-12-23</span> <a href="/nav/web/118771.html" target="_blank" class="wmd-display-block">微信内置浏览器私有接口WeixinJSBridge介绍</a> </li> <li class="wmd-margin-small-bottom wmd-position-relative"> <span>2023-12-23</span> <a href="/nav/web/118770.html" target="_blank" class="wmd-display-block">微信小程序 教程之注册页面</a> </li> </ul> </div> </section> <section class="side-art b-a b-r-4 wmd-background-default wmd-margin-bottom"> <div class="b-b wmd-padding-small wmd-clearfix wmd-flex wmd-flex-middle"> <span class="side-title side-title-style wmd-h5 wmd-float-left wmd-margin-remove wmd-position-relative">热门文章</span> </div> <ul class="wmd-list wmd-padding-remove wmd-overflow-auto wmd-sidebar-wenzhang"> <li class="wmd-margin-remove-top"> <div class="b-b wmd-padding-small"> <div wmd-grid class="wmd-grid-small"> <div class="wmd-width-1-3"> <a href="/nav/web/83903.html" class="side-art-cover b-r-4 wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/imgfile/2211/1-2211011GR2209-simg.png" alt="怎么查看Iconfont字体有哪些图标和编码" src="https://www.womengda.net/xwassets/images/default.gif" class="lazyload" > </a> </div> <div class="wmd-width-2-3 wmd-sidebar-article-c"> <div class="wmd-card"> <p class="wmd-margin-small-bottom"> <a href="/nav/web/83903.html" target="_blank" class="wmd-display-block wmd-text-truncate">怎么查看Iconfont字体有哪些图标和编码</a> </p> <div class="wmd-sidebar-article-ch wmd-text-meta wmd-margin-small-top wmd-flex"> <span class="wmd-margin-right"><i class="iconfont icon-rili"></i>2022-11-02</span> <span class="wmd-margin-right wmd-flex wmd-flex-middle"><i class="iconfont iconfont icon-yanjing"></i>1558</span> </div> </div> </div> </div> </div> </li> <li class="wmd-margin-remove-top"> <div class="b-b wmd-padding-small"> <div wmd-grid class="wmd-grid-small"> <div class="wmd-width-1-3"> <a href="/nav/web/80817.html" class="side-art-cover b-r-4 wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/imgfile/2209/1B363D93500P-1cc.jpg" alt="HTML怎么设置下划线?html文字加下划线方法" src="https://www.womengda.net/xwassets/images/default.gif" class="lazyload" > </a> </div> <div class="wmd-width-2-3 wmd-sidebar-article-c"> <div class="wmd-card"> <p class="wmd-margin-small-bottom"> <a href="/nav/web/80817.html" target="_blank" class="wmd-display-block wmd-text-truncate">HTML怎么设置下划线?html文字加下划线方法</a> </p> <div class="wmd-sidebar-article-ch wmd-text-meta wmd-margin-small-top wmd-flex"> <span class="wmd-margin-right"><i class="iconfont icon-rili"></i>2022-09-21</span> <span class="wmd-margin-right wmd-flex wmd-flex-middle"><i class="iconfont iconfont icon-yanjing"></i>1319</span> </div> </div> </div> </div> </div> </li> <li class="wmd-margin-remove-top"> <div class="b-b wmd-padding-small"> <div wmd-grid class="wmd-grid-small"> <div class="wmd-width-1-3"> <a href="/nav/web/84946.html" class="side-art-cover b-r-4 wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/imgfile/2211/1BPH2Y40930-133308.png" alt="实现css文字垂直居中的8种方法" src="https://www.womengda.net/xwassets/images/default.gif" class="lazyload" > </a> </div> <div class="wmd-width-2-3 wmd-sidebar-article-c"> <div class="wmd-card"> <p class="wmd-margin-small-bottom"> <a href="/nav/web/84946.html" target="_blank" class="wmd-display-block wmd-text-truncate">实现css文字垂直居中的8种方法</a> </p> <div class="wmd-sidebar-article-ch wmd-text-meta wmd-margin-small-top wmd-flex"> <span class="wmd-margin-right"><i class="iconfont icon-rili"></i>2022-11-13</span> <span class="wmd-margin-right wmd-flex wmd-flex-middle"><i class="iconfont iconfont icon-yanjing"></i>844</span> </div> </div> </div> </div> </div> </li> <li class="wmd-margin-remove-top"> <div class="b-b wmd-padding-small"> <div wmd-grid class="wmd-grid-small"> <div class="wmd-width-1-3"> <a href="/nav/web/79040.html" class="side-art-cover b-r-4 wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/imgfile/2208/1B1S11b22F-SI9.jpg" alt="uniapp打包成微信小程序的详细过程" src="https://www.womengda.net/xwassets/images/default.gif" class="lazyload" > </a> </div> <div class="wmd-width-2-3 wmd-sidebar-article-c"> <div class="wmd-card"> <p class="wmd-margin-small-bottom"> <a href="/nav/web/79040.html" target="_blank" class="wmd-display-block wmd-text-truncate">uniapp打包成微信小程序的详细过程</a> </p> <div class="wmd-sidebar-article-ch wmd-text-meta wmd-margin-small-top wmd-flex"> <span class="wmd-margin-right"><i class="iconfont icon-rili"></i>2022-08-31</span> <span class="wmd-margin-right wmd-flex wmd-flex-middle"><i class="iconfont iconfont icon-yanjing"></i>695</span> </div> </div> </div> </div> </div> </li> <li class="wmd-margin-remove-top"> <div class="b-b wmd-padding-small"> <div wmd-grid class="wmd-grid-small"> <div class="wmd-width-1-3"> <a href="/nav/web/79052.html" class="side-art-cover b-r-4 wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/imgfile/2208/1B1S1244c230-1G0X.png" alt="微信小程序使用uni-app开发小程序及部分功能实现" src="https://www.womengda.net/xwassets/images/default.gif" class="lazyload" > </a> </div> <div class="wmd-width-2-3 wmd-sidebar-article-c"> <div class="wmd-card"> <p class="wmd-margin-small-bottom"> <a href="/nav/web/79052.html" target="_blank" class="wmd-display-block wmd-text-truncate">微信小程序使用uni-app开发小程序及部分功能实现</a> </p> <div class="wmd-sidebar-article-ch wmd-text-meta wmd-margin-small-top wmd-flex"> <span class="wmd-margin-right"><i class="iconfont icon-rili"></i>2022-08-31</span> <span class="wmd-margin-right wmd-flex wmd-flex-middle"><i class="iconfont iconfont icon-yanjing"></i>567</span> </div> </div> </div> </div> </div> </li> </ul> </section> <script src='/adv.php?aid=1' language='javascript'></script> <section class="side-art b-a b-r-4 wmd-background-default wmd-margin-bottom"> <div class="b-b wmd-padding-small wmd-clearfix wmd-flex wmd-flex-middle"> <span class="side-title side-title-style wmd-h5 wmd-float-left wmd-margin-remove wmd-position-relative">基础教程</span> </div> <ul class="wmd-sidebar-double wmd-padding-small wmd-overflow-auto wmd-sidebar-wenzhang wmd-grid" wmd-grid=""> <li class="wmd-margin-remove-top wmd-width-1-2 wmd-first-column"> <a href="/javascript/" class="wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/2206/1-22062Q50K03Y.png" alt="JavaScript教程" src="https://oss.womengda.net/2206/1-22062Q50K03Y.png" class="b-r-4 ls-is-cached lazyloaded"> <p>学习JavaScript</p> </a> </li><li class="wmd-margin-remove-top wmd-width-1-2 wmd-first-column"> <a href="/python/" class="wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/2207/1-220F1110135351.png" alt="Python教程" src="https://oss.womengda.net/2207/1-220F1110135351.png" class="b-r-4 ls-is-cached lazyloaded"> <p>学习Python</p> </a> </li><li class="wmd-margin-remove-top wmd-width-1-2 wmd-first-column"> <a href="/android/" class="wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/2207/1-220F1110044F0.png" alt="Android教程" src="https://oss.womengda.net/2207/1-220F1110044F0.png" class="b-r-4 ls-is-cached lazyloaded"> <p>学习Android</p> </a> </li><li class="wmd-margin-remove-top wmd-width-1-2 wmd-first-column"> <a href="/html5/" class="wmd-display-block wmd-overflow-hidden"> <img data-src="https://oss.womengda.net/2206/1-22062H209361U.jpg" alt="HTML5教程" src="https://oss.womengda.net/2206/1-22062H209361U.jpg" class="b-r-4 ls-is-cached lazyloaded"> <p>学习HTML5</p> </a> </li> </ul> </section> <section class="side-tag b-r-4 b-a wmd-background-default wmd-margin-bottom"> <div class="b-b wmd-padding-small wmd-flex wmd-flex-middle"> <span class="side-title side-title-style wmd-position-relative">热门标签</span> </div> <ul class="wmd-list tags-item wmd-padding-small wmd-margin-remove"> <a wmd-tooltip="23个相关文章" href='https://www.womengda.net/pins/246_1.html' title="layui" target="_blank" class="b-r-4 wmd-text-small">layui</a> <a wmd-tooltip="1个相关文章" href='https://www.womengda.net/pins/394_1.html' title="treetable" target="_blank" class="b-r-4 wmd-text-small">treetable</a> <a wmd-tooltip="90个相关文章" href='https://www.womengda.net/pins/392_1.html' title="" target="_blank" class="b-r-4 wmd-text-small"></a> <a wmd-tooltip="3个相关文章" href='https://www.womengda.net/pins/275_1.html' title="下拉框" target="_blank" class="b-r-4 wmd-text-small">下拉框</a> <a wmd-tooltip="1个相关文章" href='https://www.womengda.net/pins/393_1.html' title="可编辑" target="_blank" class="b-r-4 wmd-text-small">可编辑</a> <a wmd-tooltip="40个相关文章" href='https://www.womengda.net/pins/1_1.html' title="html" target="_blank" class="b-r-4 wmd-text-small">html</a> <a wmd-tooltip="2个相关文章" href='https://www.womengda.net/pins/90_1.html' title="跳转" target="_blank" class="b-r-4 wmd-text-small">跳转</a> <a wmd-tooltip="2个相关文章" href='https://www.womengda.net/pins/267_1.html' title="链接" target="_blank" class="b-r-4 wmd-text-small">链接</a> <a wmd-tooltip="2个相关文章" href='https://www.womengda.net/pins/205_1.html' title="img" target="_blank" class="b-r-4 wmd-text-small">img</a> <a wmd-tooltip="32个相关文章" href='https://www.womengda.net/pins/10_1.html' title="dedecms" target="_blank" class="b-r-4 wmd-text-small">dedecms</a> <a wmd-tooltip="16个相关文章" href='https://www.womengda.net/pins/15_1.html' title="织梦" target="_blank" class="b-r-4 wmd-text-small">织梦</a> <a wmd-tooltip="71个相关文章" href='https://www.womengda.net/pins/56_1.html' title="php" target="_blank" class="b-r-4 wmd-text-small">php</a> <a wmd-tooltip="12个相关文章" href='https://www.womengda.net/pins/70_1.html' title="正则表达式" target="_blank" class="b-r-4 wmd-text-small">正则表达式</a> <a wmd-tooltip="3个相关文章" href='https://www.womengda.net/pins/289_1.html' title="匹配" target="_blank" class="b-r-4 wmd-text-small">匹配</a> <a wmd-tooltip="2个相关文章" href='https://www.womengda.net/pins/391_1.html' title="video" target="_blank" class="b-r-4 wmd-text-small">video</a> <a wmd-tooltip="140个相关文章" href='https://www.womengda.net/pins/390_1.html' title="跨域问题" target="_blank" class="b-r-4 wmd-text-small">跨域问题</a> <a wmd-tooltip="4个相关文章" href='https://www.womengda.net/pins/389_1.html' title="区块链" target="_blank" class="b-r-4 wmd-text-small">区块链</a> <a wmd-tooltip="35个相关文章" href='https://www.womengda.net/pins/388_1.html' title="定时任务" target="_blank" class="b-r-4 wmd-text-small">定时任务</a> <a wmd-tooltip="1个相关文章" href='https://www.womengda.net/pins/387_1.html' title="资源映射" target="_blank" class="b-r-4 wmd-text-small">资源映射</a> <a wmd-tooltip="88个相关文章" href='https://www.womengda.net/pins/386_1.html' title="设计模式" target="_blank" class="b-r-4 wmd-text-small">设计模式</a> <a wmd-tooltip="7个相关文章" href='https://www.womengda.net/pins/385_1.html' title="代理模式" target="_blank" class="b-r-4 wmd-text-small">代理模式</a> <a wmd-tooltip="15个相关文章" href='https://www.womengda.net/pins/384_1.html' title="EasyExcel" target="_blank" class="b-r-4 wmd-text-small">EasyExcel</a> <a wmd-tooltip="2个相关文章" href='https://www.womengda.net/pins/383_1.html' title="运行原理" target="_blank" class="b-r-4 wmd-text-small">运行原理</a> <a wmd-tooltip="14个相关文章" href='https://www.womengda.net/pins/382_1.html' title="归并排序" target="_blank" class="b-r-4 wmd-text-small">归并排序</a> <a wmd-tooltip="88个相关文章" href='https://www.womengda.net/pins/359_1.html' title="排序算法" target="_blank" class="b-r-4 wmd-text-small">排序算法</a> <a wmd-tooltip="9个相关文章" href='https://www.womengda.net/pins/381_1.html' title="希尔排序" target="_blank" class="b-r-4 wmd-text-small">希尔排序</a> <a wmd-tooltip="25个相关文章" href='https://www.womengda.net/pins/380_1.html' title="快速排序" target="_blank" class="b-r-4 wmd-text-small">快速排序</a> <a wmd-tooltip="21个相关文章" href='https://www.womengda.net/pins/361_1.html' title="冒泡排序" target="_blank" class="b-r-4 wmd-text-small">冒泡排序</a> <a wmd-tooltip="10个相关文章" href='https://www.womengda.net/pins/379_1.html' title="经典算法" target="_blank" class="b-r-4 wmd-text-small">经典算法</a> <a wmd-tooltip="16个相关文章" href='https://www.womengda.net/pins/378_1.html' title="Nacos" target="_blank" class="b-r-4 wmd-text-small">Nacos</a> <a wmd-tooltip="28个相关文章" href='https://www.womengda.net/pins/377_1.html' title="对象转换" target="_blank" class="b-r-4 wmd-text-small">对象转换</a> <a wmd-tooltip="267个相关文章" href='https://www.womengda.net/pins/335_1.html' title="Springboot" target="_blank" class="b-r-4 wmd-text-small">Springboot</a> <a wmd-tooltip="14个相关文章" href='https://www.womengda.net/pins/74_1.html' title="mysql" target="_blank" class="b-r-4 wmd-text-small">mysql</a> <a wmd-tooltip="1个相关文章" href='https://www.womengda.net/pins/376_1.html' title="远程连接" target="_blank" class="b-r-4 wmd-text-small">远程连接</a> <a wmd-tooltip="92个相关文章" href='https://www.womengda.net/pins/375_1.html' title="过滤器" target="_blank" class="b-r-4 wmd-text-small">过滤器</a> <a wmd-tooltip="47个相关文章" href='https://www.womengda.net/pins/374_1.html' title="监听器" target="_blank" class="b-r-4 wmd-text-small">监听器</a> <a wmd-tooltip="39个相关文章" href='https://www.womengda.net/pins/373_1.html' title="多进程" target="_blank" class="b-r-4 wmd-text-small">多进程</a> <a wmd-tooltip="23个相关文章" href='https://www.womengda.net/pins/372_1.html' title="图片上传" target="_blank" class="b-r-4 wmd-text-small">图片上传</a> <a wmd-tooltip="21个相关文章" href='https://www.womengda.net/pins/371_1.html' title="无刷新" target="_blank" class="b-r-4 wmd-text-small">无刷新</a> <a wmd-tooltip="1个相关文章" href='https://www.womengda.net/pins/370_1.html' title="wushuaxi" target="_blank" class="b-r-4 wmd-text-small">wushuaxi</a> </ul> </section> </div> </div> </div> </div> <!--内页专题--> </section> </main> <div class="wmd-app-gotop gotops wmd-hidden@s" id="gotops"> <a href="#header" class="wmd-display-block" wmd-scroll> <i class="iconfont icon-arrow-up"></i> </a> </div><!--Banner--> <footer class="footer wmd-background-secondary"> <div class="foot wmd-container wmd-padding"> <div class="wmd-grid" wmd-grid> <div class="wmd-width-1-1@s wmd-width-1-3@xl"> <div class="foot-item foot-item-first wmd-position-relative"> <a href="" target="_blank" class="foot-logo wmd-display-block"><img src="https://www.womengda.net/xwassets/images/flogo.png"></a> <p class="wmd-text-small">沃梦达教程网是一个专门为菜鸟打造的前端开发和软件编程的学习网站,可以为编程者和程序员提供海量技术文档,以便编程初学者快速入门,提升开发技术水平和工作效率。</p> </div> </div> <div class="wmd-width-2-3 wmd-visible@s"> <div class="wmd-grid" wmd-grid> <div class="wmd-width-1-3"> <div class="foot-item"> <div class="foot-item-title"><i class="iconfont icon-anquan"></i>编程基础</div> <ul class="wmd-padding-remove"> <li><a href="/acode_h/" target="_blank"> HTML/CSS</a></li><li><a href="/acode_js/" target="_blank"> JAVASCRIPT</a></li><li><a href="/acode_php/" target="_blank"> PHP</a></li><li><a href="/acode_java/" target="_blank"> JAVA</a></li><li><a href="/acode_net/" target="_blank"> ASP.NET</a></li><li><a href="/acode_python/" target="_blank"> Python</a></li> </ul> </div> </div> <div class="wmd-width-1-3"> <div class="foot-item"> <div class="foot-item-title"><i class="iconfont icon-anquan"></i>编程教程</div> <ul class="wmd-padding-remove"><li><a href="/program/" target="_blank">编程基础</a></li><li><a href="/nav/" target="_blank">IT编程</a></li><li><a href="/ask/" target="_blank">编程问答</a></li><li><a href="/demo/" target="_blank">实例代码</a></li> </ul> </div> </div> </div> </div> </div> </div> <div class="foot-cop"> <div class="wmd-container wmd-padding-small wmd-clearfix"> <div class="wmd-float-left"> <span>© 2023-2024 沃梦达 版权所有并保留所有权</span> <a class="wmd-margin-small-right" href="https://www.womengda.net/sitemap.xml" target="_blank"><i class="iconfont icon-location-fill" aria-hidden="true"></i> 网站地图</a> <span class="wmd-margin-small-right"><a href="https://beian.miit.gov.cn/" target="_blank" rel="noreferrer nofollow">ICP备案号:<a href="https://beian.miit.gov.cn/" rel="nofollow" style="color:#bbb">粤ICP备14083021号</a></a></span>   </div> </div> </div> <script type='text/javascript' src='https://www.womengda.net/xwassets/js/jquery.cookie.js'></script> </footer> <!--手机端菜单--> <div class="wmd-app-footer-fixed wmd-app-footer wmd-hidden@s"> <a href="https://www.womengda.net"> <span class="icon"> <i class="iconfont icon-home"></i> </span> <span class="text">网站首页</span> </a> <a href="/acode_h/"> <span class="icon"> <i class="iconfont icon-read-fill"></i> </span> <span class="text">HTML/CSS</span> </a> <a class="cat" wmd-toggle="target: #mob-nav"> <span class="icon"> <i class="iconfont icon-all"></i> </span> <span class="text">菜单</span> </a> <a href="/layui/"> <span class="icon"> <i class="iconfont icon-dropbox"></i> </span> <span class="text">Layui</span> </a> <a href="/yii2/"> <span class="icon"> <i class="iconfont icon-appstore-fill"></i> </span> <span class="text">Yii2</span> </a> </div> <div id="mob-nav" wmd-offcanvas> <div class="wmd-offcanvas-bar wmd-background-default wmd-box-shadow-small wmd-mobnav-box"> <div class="mob-nav"> <div class="wmd-margin-small-bottom wmd-text-center"> <a href="https://www.womengda.net" class="logo wmd-display-inline-block wmd-margin-bottom"><img src="/xwassets/images/logo.png"></a> </div> <ul class="nav"><li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home"><a href="https://www.womengda.net">网站首页</a></li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_h/">HTML/CSS</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/html/">HTML</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/html5/">HTML5</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/css/">CSS</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/css3/">CSS3</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/saas/">Sass</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/layui/">Layui</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/bootstrap3/">Bootstrap3</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/bootstrap4/">Bootstrap4</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/bootstrap5/">Bootstrap5</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/appml/">AppML</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/awesome/">Font Awesome</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/foundation5/">Foundation5</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_js/">JAVASCRIPT</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/javascript/">JavaScript</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/jquery/">jQuery</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/angularjs/">AngularJS</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/angularjs2/">AngularJS2</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/vue/">Vue.js</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/vue3/">Vue3</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/react/">React</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/typescript/">TypeScript</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/easyui/">EasyUI</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/node/">Node.js</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/ajax/">AJAX</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/json/">JSON</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/echarts/">Echarts</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/highcharts/">Highcharts</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_php/">PHP</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/php/">PHP</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/laravel/">Laravel</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/cakephp/">CakePHP</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/codeigniter/">CodeIgniter</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/zend/">Zend</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/symfony/">Symfony</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/yii2/">Yii2</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/phalcon/">Phalcon</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/thinkphp/">ThinkPHP</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/smarty/">Smarty</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_java/">JAVA</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/java/">JAVA</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/spring/">Spring</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/hibernate/">Hibernate</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/struts/">Struts</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/play/">Play</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/toolkit/">GWT</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/jsp/">Jsp</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/maven/">Maven</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/servlet/">Servlet</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_net/">ASP.NET</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/aspnet/">ASP.NET</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/csharp/">C#</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/webpages/">Web Pages</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/razor/">Razor</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/mvc/">MVC</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/webforms/">Web Forms</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_python/">Python</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/python/">Python</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/python3/">Python 3</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/django/">Django</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_go/">Go</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/go/">Go</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/docker/">Docker</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/beego/">Beego</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/buffalo/">Buffalo</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/echo/">Echo</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/gin/">Gin</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/iris/">Iris</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/revel/">Revel</a></li> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/ruby/">Ruby</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/c/">C</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/cplus/">C++</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/perl/">Perl</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/lua/">Lua</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/rust/">Rust</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/scala/">Scala</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/vb/">VB</a> <ul class="sub-menu" style='display:none;'> </ul> </li><li class="menu-item menu-item-type-custom menu-item-object-custom current-menu-ancestor current-menu-parent menu-item-has-children "><a href="/acode_m/">移动端</a> <ul class="sub-menu" > <li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/android/">Android</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/swift/">Swift</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/ionic/">ionic</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/kotlin/">Kotlin</a></li><li class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="/harmonyos/">HarmonyOS</a></li> </ul> </li> </ul></div> </div> </div> </div> <script type='text/javascript' src='https://www.womengda.net/xwassets/js/index.js'></script> <style> .night .wmd-logo-nav-night{ background: url(https://www.womengda.net/xwassets/images/flogo.png) no-repeat!important; background-size: 150px auto; } .night .wmd-app-logo2{ background: url(https://www.womengda.net/xwassets/images/flogo.png) no-repeat!important; background-size: 92px auto!important; } #canvas { position: absolute; left: 0; top: 0; } </style> <script src="https://www.womengda.net/xwassets/js/highlight.min.js?v=1"></script> <script src="https://www.womengda.net/xwassets/js/prism.min.js?v=1"></script> <script src="https://www.womengda.net/xwassets/js/prism.js?v=1"></script> </body> </html>