桐乡建设局网站,网站开发背景图,番禺网站建设哪家强,无锡阿凡达网站建设Crow:设置网站的index.html-CSDN博客 讲述了如何完成一个最简单的网页的路由 很多网页提供了下载功能,怎么实现呢,其实也很简单。 假设网页的目录结构如图 $ tree static static ├── img │ └── goodday.jpg └── index.html //index.html
html
body└── goodday.jpg └── index.html //index.html
html
bodyh1Hello world/h1
img src="/static/img/goodday.jpg" alt="good day" style="width: 500px;" onclick="downloadimg('goodday1.jpg')"scriptfunction downloadFile (data, fileName){var blob = new Blob([data]);var downloadElement = document.createElement('a');var href = window.URL.createObjectURL(blob);downloadElement.href = href;