【笔记】使用 html 创建网址快捷方式

有时需要这个功能,对于一些手册网站,离线保存网页效果又不好时。

可以创建一个简单的 HTML 文件,双击后在默认浏览器中打开指定的网址(甚至是自动跳转)。以下是几种 HTML 实现方式:


方法 1:纯 HTML 自动跳转(最快)

html 复制代码
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="refresh" content="0; url=https://docs.espressif.com/projects/esp-dev-kits/zh-cn/latest/other/esp-prog/user_guide.html">
    <title>ESP-Prog 文档</title>
</head>
<body>
    <p>正在跳转到 <a href="https://docs.espressif.com/projects/esp-dev-kits/zh-cn/latest/other/esp-prog/user_guide.html">ESP-Prog 文档</a>...</p>
</body>
</html>

说明

  • meta http-equiv="refresh" 会让浏览器 立即跳转content="0" 表示 0 秒后跳转)。
  • 备份链接 (<a> 标签) 确保即使跳转失败也能手动点击访问。
  • 保存方式 :复制代码 → 用记事本保存为 ESP-Prog_Docs.html → 双击打开。

方法 2:JavaScript 跳转(可选)

html 复制代码
<!DOCTYPE html>
<html>
<head>
    <title>ESP-Prog 文档</title>
    <script>
        window.location.href = "https://docs.espressif.com/projects/esp-dev-kits/zh-cn/latest/other/esp-prog/user_guide.html";
    </script>
</head>
<body>
    <p>如果未自动跳转,请<a href="https://docs.espressif.com/projects/esp-dev-kits/zh-cn/latest/other/esp-prog/user_guide.html">点击这里</a>。</p>
</body>
</html>

说明

  • 使用 window.location.href 实现 JS 跳转,效果与方法 1 类似。

相关推荐
sakiko_1 小时前
UIKit学习笔记2-组件嵌套、滚动视图等
笔记·学习·objective-c·swift·uikit
Alice-YUE2 小时前
【JS高频八股】什么是闭包?
开发语言·javascript·笔记·学习
宵时待雨2 小时前
linux笔记归纳3:linux开发工具
linux·运维·笔记
摇滚侠3 小时前
Java 零基础全套视频教程,面向对象(高级),笔记 105-120
java·开发语言·笔记
tq10864 小时前
程序行为的效应构成:约束、规则与延迟固化的统一视角
笔记
Alice-YUE4 小时前
前端图片优化完全指南:从格式到加载的全面提速方案
前端·笔记·学习
路光.4 小时前
ReferenceError:Can‘t find variable:structureClone
前端·javascript·html·vue2
Stella Blog4 小时前
狂神Java基础学习笔记Day05
java·笔记·学习
枷锁—sha4 小时前
【CTFshow-pwn系列】03_栈溢出【pwn 073】详解:静态编译下的自动化 ROP 链构建
网络·汇编·笔记·安全·网络安全·自动化
你数过天上的星星吗5 小时前
Python学习笔记二(函数、类与对象)
笔记·python·学习