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

在这里插入图片描述

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

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


方法 1:纯 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 跳转(可选)

<!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 类似。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值